Update Question

  • Thread starter Thread starter jay
  • Start date Start date
J

jay

I have a form that I enter data and then I click a button to
print a report. The data that I typed in does not appear unless I
save the form or scroll the mouse wheel.

Is there a way that as I type the data the form saves without
me having to click save every time?
 
yes, just force a disk write.....


if me.dirty = True then
me.dirty = false
end if

docmd.OpenReprot "your reprot".......
 
I have a form that I enter data and then I click a button to
print a report. The data that I typed in does not appear unless I
save the form or scroll the mouse wheel.

Is there a way that as I type the data the form saves without
me having to click save every time?

Explicitly save the record in the button's Click event.

To do so: open the form in design view; view the button's properties. On the
Events tab it should say [Event Procedure] on the Click event (if it doesn't,
post back with what it does say). Click the ... icon by this. Some VBA code
will appear in the VBA editor.

On the line before it says

DoCmd.OpenReport ... <other stuff>

put

If Me.Dirty Then Me.Dirty = False

This will write the record out to the table prior to the report reading from
the table.

John W. Vinson [MVP]
 
John said:
I have a form that I enter data and then I click a button to
print a report. The data that I typed in does not appear unless I
save the form or scroll the mouse wheel.

Is there a way that as I type the data the form saves without
me having to click save every time?

Explicitly save the record in the button's Click event.

To do so: open the form in design view; view the button's properties. On
the Events tab it should say [Event Procedure] on the Click event (if it
doesn't, post back with what it does say). Click the ... icon by this.
Some VBA code will appear in the VBA editor.

On the line before it says

DoCmd.OpenReport ... <other stuff>

put

If Me.Dirty Then Me.Dirty = False

This will write the record out to the table prior to the report reading
from the table.

John W. Vinson [MVP]

Ok. Thank you again.
 

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

Back
Top