LU TABLE vs HARD CODE

  • Thread starter Thread starter BobF
  • Start date Start date
B

BobF

I have a several check boxes in a form, if any of the
boxes are checked a hard coded value is put into an
associated text box:
If MONITOR.VALUE = TRUE THEN
MONITORCHARGE = 175.00
END IF

What I would like to be able to do is access a table
named "LU_CHARGES":
If MONITOR.VALUE = TRUE THEN
MONITORCHARGE = LU_CHARGES.MONITORCHARGE
END IF

Is there a way I can set these values into a Lookup Table
and automatically replace the values when these values are
updated?
 
Is there a way I can set these values into a Lookup Table
and automatically replace the values when these values are
updated?

I am not sure if you are talking about controls on forms, or recordset
values here.

If it's the former, then it's very easy to set up the kind of switch you
had before:

If chkMonitor = True Then
txtMonitorCharge.Value = DLookup("[DollarValue]", "Charges", _
"[Item]=""Monitor""")
End If


If you are talking about values in tables, though, you need to consider the
design quite carefully. Do you need to store the amount as it is now or
should it change with changes in the look up table? Do you really need the
True/False value -- what happens when Monitor=False but there's a value in
MonitorCharge anyway? Etc.


Best wishes


Tim F
 
Back
Top