assigning a result of a query to a text box

A

Alex

How could I assign a result of a query to a text box?
I'm trying

Me.txtTextBox.ControlSource = [qryQuery]![Field]

but it's not working.

The result of the query is just one number.

Thanks
 
H

Howard Brody

Use a DLookUp function (check the Help files for details) instead of a query
Even if it only returns one record with one field, Access doesn't like to use a query as the source for a TextBox

Hope this helps

----- Alex wrote: ----

How could I assign a result of a query to a text box
I'm tryin

Me.txtTextBox.ControlSource = [qryQuery]![Field

but it's not working

The result of the query is just one number

Thank
 
A

Alex

Thank you vary much.
It's working perfectly.
-----Original Message-----
Use a DLookUp function (check the Help files for details) instead of a query.
Even if it only returns one record with one field, Access
doesn't like to use a query as the source for a TextBox.
Hope this helps!

----- Alex wrote: -----

How could I assign a result of a query to a text box?
I'm trying

Me.txtTextBox.ControlSource = [qryQuery]![Field]

but it's not working.

The result of the query is just one number.

Thanks


.
 

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