LU TABLE vs HARD CODE

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?
 
T

Tim Ferguson

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top