Michelle,
gigaboy is, in essence, right, even though he hasnt really solved your problem.
My suggestion would be to set up a function for this. It takes two inputs (Schedule and Diameter) and gives one output (the result).
You will need to set up a table with your values, I would suggest just entering your data in a basic way, ie:
3 fields:
tblValues:
ScheduleType (1,2,3,4 etc)
DiameterType (1,2,3,4,5 etc)
Value (1.67, 2.33, 3.42 etc)
Doing it this way means you arent forced to come up with values for combinations that dont exist and also means you do not have to redesign your table if "Diameter 6" or "Schedule 5" comes along all of a sudden. You just simply add the new data.
You then want to do something along the lines of the following in a new module:
================================================== ====
public function pfunGetValue(lngSchedule as long, lngDiameter as long) as long
dim rst as recordset
dim strSQL as string
strsql = "Select Value from tblValues where Schedule = " & lngSchedule & _
" AND Diameter = " & lngDiameter
set rst = currentdb.openrecordset(strsql)
pfunGetValue = rst!Value
rst.close
End function
================================================== ====
You might want to use something like:
pfunGetValue = nz(rst!Value,-999) as a not found identifier, instead though.
You can now simply use the function in your database, gives you a more dynamic way to use the data, on reports, in queries, etc
Use it like...
pfunGetValue(1,1) and should return 1.67 from your example.
Hope it helps.
Lee
|