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


.
 
Top