Dlookup and combo boxes

kkershaw

Registered User.
Local time
Today, 18:26
Joined
Apr 11, 2002
Messages
17
Please help a poor fool! I have read through the form forum and tried some of the suggestions to help me with my problem, but no luck. Here it is:

In my form I have a combo box with one column showing 'destination' and the other column shows a 'rate'. The combo box list was created from a query based on a table. I would like it if when I choose the 'destination' from the combo box, the rate would appear in my 'rate' text box so that I can use it in a calculation later in the form, and have the rate appear correctly in the underlying table. I have tried the =[combo box name] method, but I must be doing it wrong.

Could someone please spell it out for me step by step? I have also tried using DLookup but I am unable to get the criteria portion right. Thank you very much.
 
To show the rate in a textbox, in the controlsource of the textbox, set it to

Forms!NameofForm!NameofCombo.Colum(x) where x is the column where the rate is (starts at 0).
You obviously have the rate stored in the Db somewhere in order to show it so avoid storing it again unless you are doing an audit trail of previous rates.

In your calculation, you can then refer to the column in the combo as described or the textbox but avoid storing this calculation, just create it dynamically, when you need it.
HTH
 
Thank you. That worked. The next problem is I can't get 'rate' to format to currency with 2 decimal places. Can you advise? Why would that occur?

i.e. 5.8 should look like $5.80.

Thanks again.
 
=Format(Forms!FormName.ComboName.Column(x),"Currency") should work. What are you trying so far?

David R
 

Users who are viewing this thread

Back
Top Bottom