If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
How to do Lookup
I have a form that has a field called Currency Type and a field called
Exchange Rate. I have a table has a column for both of these with date in each column. I want to enable the Currency Type field auto populate the Exchange Rate field when the user selects a currency type (i.e. user selects EUR as the Currency Type; Exchange Rate field will automatically be fill in with the exchange rate that is listed in the table). Have tried everything could think of to get this to work, but with no luck. How do I get this to work? |
#2
|
|||
|
|||
How to do Lookup
Hi TizTIz,
Use a dlookup similar to this: =dlookup("EXCHANGE_RATE", "EXCHANGE_RATE_TABLE", "[CURRENCY_TYPE] = '" & me.CURRENCY_TYPE_FIELD & "'") Replace the bits in caps with the appropriate field/table names. Hope that helps. Damian. "TizTIz" wrote: I have a form that has a field called Currency Type and a field called Exchange Rate. I have a table has a column for both of these with date in each column. I want to enable the Currency Type field auto populate the Exchange Rate field when the user selects a currency type (i.e. user selects EUR as the Currency Type; Exchange Rate field will automatically be fill in with the exchange rate that is listed in the table). Have tried everything could think of to get this to work, but with no luck. How do I get this to work? |
#3
|
|||
|
|||
How to do Lookup
Damien's code can be used in the ControlSource property of a textbox control
in your form, to *display* the appropriate exchange rate - but it will not populate a field in the form's underlying table. if you want to capture the current exchange rate and save it in the record, you can use the DLookup() function to retrieve it, in a macro or VBA code, and then set the value of a field in the record to the retrieved rate. hth "TizTIz" wrote in message ... I have a form that has a field called Currency Type and a field called Exchange Rate. I have a table has a column for both of these with date in each column. I want to enable the Currency Type field auto populate the Exchange Rate field when the user selects a currency type (i.e. user selects EUR as the Currency Type; Exchange Rate field will automatically be fill in with the exchange rate that is listed in the table). Have tried everything could think of to get this to work, but with no luck. How do I get this to work? |
Thread Tools | |
Display Modes | |
|
|