Populate Text box with query result

G

Gregory

I have a form that has a textbox on it. I would like to populate the textbox with the result of a query(which will always be 1 number) on the "On Open" event but can't seem to get it to work

Any ideas are greatly appreciated.....
 
R

Rick Brandt

Gregory said:
I have a form that has a textbox on it. I would like to populate the
textbox with the result of a query(which will always be 1 number) on the
"On Open" event but can't seem to get it to work.
Any ideas are greatly appreciated.....

Unless it is a ComboBox or ListBox you can't display the results of a query
directly in a control. You can use a DLookup() function against the query
or you can create a custom function to read a RecordSet based on the query
and return the value.
 

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