Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Querying a table for a form...

Status
Not open for further replies.

zahara666

Technical User
Nov 1, 2001
78
CA
My logic is simple I think, but I can't seem to correctly place it into Access. This is what I need to do:

I have a form where a user picks from a list of words (basic, standard, intermediate) and once the user picks one of those options, I need to go into a table (called RateTable) and look up a value based on the option AND the client code.

For example, I am in client code 2 (on my form), and I pick Basic (from a field in the form). I want it to go to the RateTable at row 2 under the column Basic and give me the number. I want it to place that number into another field on the form that is open... Need help desperately for this one, my knowledge on sql is very limited as my knowledge of access (anything that includes code is a bit difficult for me)... help! please! ASAP...
 
In the controlsource property of the control you wish to display the results of the lookup in use the following syntax (replace the placeholders given with the actual names of your objects):

=DLookUp("Rate", "RateField", "[RowIdentifier] = Forms!FormName!RowField And [TypeIdentifier] = Forms!FormName!Type")

NOTE: There must only be one valid record for each combination of ID and Type.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top