Update Form with Command Button

R

RMires

I have a report which is created using criteria entered into a form. There is
already a button on the form which opens the report. If someone does not tab
out of a particular box then sometimes the the control isn't updated and the
report doesn't get the proper criteria. I can use the button to update all of
the individual controls before creating the form, but can I use the button to
update the entire form instead?
 
J

John W. Vinson

I have a report which is created using criteria entered into a form. There is
already a button on the form which opens the report. If someone does not tab
out of a particular box then sometimes the the control isn't updated and the
report doesn't get the proper criteria. I can use the button to update all of
the individual controls before creating the form, but can I use the button to
update the entire form instead?

The problem isn't that the textbox still has the focus - clicking the button
changes the focus, just as tabbing out would. The problem is probably that the
record is still on the form but not yet written to the table (to become
available for the report). If it's a bound form you can force a write to disk
using

If Me.Dirty Then Me.Dirty=False

in your button code.
 

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