Update Form with Command Button

  • Thread starter Thread starter RMires
  • Start date Start date
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?
 
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.
 
Back
Top