query result in text box

J

Jeannine

Hi,

I am creating a database that is designed to perform calculations on data
that is input daily. I have made a form on which to input the data and there
are two text boxes that perform the queries and show the results, however the
text boxes show results before the data is completely typed in. The results
won't show correctly until I close and reopen the form. What can I do to have
the query initiate after the data is input or to have it refresh?

Thank you,
 
D

Dale Fye

Jeannine,

In that situation, I would generally make the textboxes where you want to
see the results as unbound, and would not set their control sources to
anything.

Then, I would add a command button (cmdResults) to your form, that sets the
values of those controls (runs the queries and puts the results into the
"value" property of the textbox.

I would also setup the other controls on your form so that when the values
in any of those fields are changed (use the change event), it clears out the
value of your results textboxes. This way, as soon as you make a change in
any of the other controls, the "results" will disappear until you click the
"cmdResults" button.
 
D

Dale Fye

As an alternative to my previous post, you could also use the AfterUpdate
event of the various controls to requery the results textboxes.
 

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