Query as the control source

Brando

Enthusiastic Novice
Local time
Today, 10:51
Joined
Apr 4, 2006
Messages
100
Hi,

Novice question: Is it possible to have a query be the control source for a text box on a form? The code I have been trying to implement is:

SELECT Table2.FirstName FROM Table2 WHERE LastName = "Anderson";

If I could figure that much out, I would replace "Anderson" with another text box on the form.

Thank you for your help.
 
No, you can't set the recordsource of a text box to be a query or field from a query (directly that is). You can use a DLookup, however that is fairly slow. Normally you just have the record source of the form be what you need and you then have the controls be bound to those fields.

Then, for some fields you use combo boxes or list boxes bound to a field to be able to select from the text but still store the ID number in the background in that field.
 
Thank you! That points me in the right direction.

PS. Bob, I like your new Icon!
 

Users who are viewing this thread

Back
Top Bottom