Solved Pulling Data from a Query Field to be Displayed in a Textbox (1 Viewer)

Bean Machine

Member
Local time
Today, 06:55
Joined
Feb 6, 2020
Messages
102
Hi All!

I am wanting to pull the value from a field in a query to be displayed in a textbox. As seen in the image attached I tried referencing it as follows "[qry_SPL3]![fld_IDIT]" but this just gives me the "#Name?" error also as seen in attached.
txtbox example.png
error message example.png
Below is what the Query I am trying to pull from looks like.
query example.png
Any help would be greatly appreciated. I am at a complete loss.
 

plog

Banishment Pending
Local time
Today, 05:55
Joined
May 11, 2011
Messages
11,646
I'd give a read to this:


Generally a form is bound to a datasource (Table or Query). If that is the case, you simply set the control source like you did to the name of the field (you wouldn't also reference the datasource because the form knows). If you have an unbound form or want to reference a value in a datasource that the form is not bound to you need to use DLookup


Instead of setting the control equal to the field you set it to the properly constructed Dlookup and it retrieves that value. Here's a very crude example that does not use your specific data:

=DLookup("[FieldName]", "DataSourceName")
 

Bean Machine

Member
Local time
Today, 06:55
Joined
Feb 6, 2020
Messages
102
I'd give a read to this:


Generally a form is bound to a datasource (Table or Query). If that is the case, you simply set the control source like you did to the name of the field (you wouldn't also reference the datasource because the form knows). If you have an unbound form or want to reference a value in a datasource that the form is not bound to you need to use DLookup


Instead of setting the control equal to the field you set it to the properly constructed Dlookup and it retrieves that value. Here's a very crude example that does not use your specific data:

=DLookup("[FieldName]", "DataSourceName")
This worked great thank you so much for the help! I hope you have a great day!

new txtbox.png
 

Users who are viewing this thread

Top Bottom