Selecting Values from a value in a form

Krikkit

New member
Local time
Today, 13:21
Joined
Apr 20, 2006
Messages
6
Right.
What I want to do is use a value obtained in the form (obtained from a list-box selection) to select a record in a table, then return one of the fields to a text-box on the form.
All the values coming from the list-box are unique, and the value returned is a simple integer.

Is there any way to do this reasonably simply?
 
Yes you can use the Dlookup function to do this
 
KeithG said:
Yes you can use the Dlookup function to do this
Enough of a Leg-end to be a foot. Cheers for that. :D
 
Got problems. Can anyone spot the flaw with this?
Just 2 textboxes and a button, linking to a table. Gives me a blank value.

Text45.Value = DLookup("[ID]", "test", "[Test 2] = Text50.Text")
 
me.Text45 = DLookup("[ID]", "test", "[Test 2] = " & me.Text50)
 
Thanks, but now I get run-time error 2001. Copied your code exactly, and nothing else is going on. Any ideas?
 

Users who are viewing this thread

Back
Top Bottom