QBF - trying to get the results to display in text boxes

  • Thread starter Thread starter alexchen11
  • Start date Start date
A

alexchen11

So I have a QBF query set up that selects the sums of all the sales in
a certain month (whose value is from a text box). The query works
correctly but it opens up as a new datasheet. Is it possible for me to
get the values from the query to populate text boxes in the current
form (or even a subform)?

Thanks for your help, everyone!

Alex
 
yeah bind the form to the query.. set the forms 'recordsource' property
equal to the name of the query

and then set the controlSource argument for any textbox that you want
to bind to a field

hope that helps

-Aaron
 
Alex:

Set the form's RecordSource property to the name of your query and add text
boxes bound to the query's columns to the form. In the AfterUpdate event
procedure of the unbound text box which the query references as a parameter
requery the form with:

Me.Requery

Alternatively remove the reference to the text box from the query, create a
form bound to the query and insert it as a subform in the form. Set the
subform control's LinkMasterFields property to the name of the text box (you
don't need to fully qualify the name, just the name of the control is
enough), and the LinkChildFields property to the name of the month column in
the query.

Ken Sheridan
Stafford, England
 
There are a number of different ways but using DLookUp() function is
probably the easiest for you at the moment.

Check Access Help on DLookUp (and other Domain Aggregate functions).
 
Back
Top