How do you go about setting a textbox on a form = a return value of a query?
Let's say I have a customer table.
Customer
Customer ID
Customer Name
Customer Phone
Customer Address
And on my form I have 2 text boxes (& a submit button).
One text box is a search field to look up the customer by ID.
When I click a button to look it up, how do I put [Customer].[Customer Name] in the other textbox?
Do I have to do something like:
qd = db.QueryDefs(queryName)
strSQL="SELECT [Customer Name] FROM Customer WHERE [Customer ID] = textbox1;"
qd.SQL = strSQL
textbox2 = docmd.openQuery (queryName,acViewNormal, acReadOnly)
because while that sounds good openQuery has no return value... it opens a query window..but doesn't return anything. So ARGH...I'm stuck.
Let's say I have a customer table.
Customer
Customer ID
Customer Name
Customer Phone
Customer Address
And on my form I have 2 text boxes (& a submit button).
One text box is a search field to look up the customer by ID.
When I click a button to look it up, how do I put [Customer].[Customer Name] in the other textbox?
Do I have to do something like:
qd = db.QueryDefs(queryName)
strSQL="SELECT [Customer Name] FROM Customer WHERE [Customer ID] = textbox1;"
qd.SQL = strSQL
textbox2 = docmd.openQuery (queryName,acViewNormal, acReadOnly)
because while that sounds good openQuery has no return value... it opens a query window..but doesn't return anything. So ARGH...I'm stuck.