Insertinmg the results of a Query into a text box

mikefish

New member
Local time
Today, 09:47
Joined
Jan 30, 2008
Messages
8
I have a form Dispatch_Email_Query which contains a text box named Inv the contents of which is provided by the query used to create the form and is a 4 digit number matching an invoice.

I have a query [Query_By_Invoice_Dispatch] which takes a value as input (Invoice Number) and displays all references for that invoice number. As a stand along query it works fine with me typing in the invoice value. It asks for Forms!Dispatch_Email_Query!Inv


What I would like to do is have the results of the Query for the value contained in Inv on the Dispatch_Email_Query form appear in a text box on the Dispatch_Email_Query form

But I can't get it to work, is it possible to do ?

I am new at VBA background is in ASP what I am after is something like...

Select Reference From Dispatch Where Invoice = Inv

Any help anyone can give much appreciated
 
I have a form Dispatch_Email_Query which contains a text box named Inv the contents of which is provided by the query used to create the form and is a 4 digit number matching an invoice.

I have a query [Query_By_Invoice_Dispatch] which takes a value as input (Invoice Number) and displays all references for that invoice number. As a stand along query it works fine with me typing in the invoice value. It asks for Forms!Dispatch_Email_Query!Inv


What I would like to do is have the results of the Query for the value contained in Inv on the Dispatch_Email_Query form appear in a text box on the Dispatch_Email_Query form

But I can't get it to work, is it possible to do ?

I am new at VBA background is in ASP what I am after is something like...

Select Reference From Dispatch Where Invoice = Inv

Any help anyone can give much appreciated

Go to the properties of the textbox on the form. Go to the Data Tab and select the "...". This should open a Expression Builder. Find the Query and field you want this field to represent.
 
Thats what I had tried but it just gives me a #Name? error

It gives =[Query_By_Invoice_Dispatch]![Inv] as the Control Source

The query works fine when run directly, I just can't get it to run from the textbox
 
Last edited:

Users who are viewing this thread

Back
Top Bottom