Txt box value from query field

S

So Call Me Crazy

Access 2007

FormA uses TableA. TableA has FieldA which is a very non-descript code.
TableB is related to TableA on that field (FieldA) and has all the
descriptive info behind the non-descript code.

I created a query to retrieve from TableB the descriptive info based on the
value of FieldA on the form.

When I run the query, it behaves correctly. I get the 1 record from TableB
that I am expecting.

When I try to populate a text field on FormA from one of the fields from the
query, I get #Name.

Seems simple enough. But, alas, not working.

TIA.
 
J

John W. Vinson

Access 2007

FormA uses TableA. TableA has FieldA which is a very non-descript code.
TableB is related to TableA on that field (FieldA) and has all the
descriptive info behind the non-descript code.

I created a query to retrieve from TableB the descriptive info based on the
value of FieldA on the form.

When I run the query, it behaves correctly. I get the 1 record from TableB
that I am expecting.

When I try to populate a text field on FormA from one of the fields from the
query, I get #Name.

Seems simple enough. But, alas, not working.

TIA.

How are you "trying to populate the field"????

Just having a query in your database won't automagically display it on the
form. I'd suggest either of two solutions:

- If the description is shorter than 255 bytes, put a Combo Box on the form,
bound to FieldA, based on TableA. This could display the description while
storing the code.
- If the description is longer (a memo field) in TableA, put a Textbox on the
form with a control source

=DLookUp("[Description]", "[TableA]", "[FieldA] = '" & [txtFieldA] & "'")

With either of these choices your query may be unneeded (though you might end
up using it as the rowsource for your combo box).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top