Update Question

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?
 
A

Albert D. Kallal

yes, just force a disk write.....


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

docmd.OpenReprot "your reprot".......
 
J

John W. Vinson

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]
 
J

jay

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.
 
Top