How to send form data to tables programatically

  • Thread starter Thread starter markmarko
  • Start date Start date
M

markmarko

Is there a way to programatically have a form update to the underlying tables?

What I mean is... As a user types into a form, Access doesn't seem to
actually send that data to the table (and thereby create autonumbers) until
user moves on to another record.

Is there a way to force that data to the tables (ie make the new records)
while the user is still on the form?
 
Is there a way to programatically have a form update to the underlying tables?

What I mean is... As a user types into a form, Access doesn't seem to
actually send that data to the table (and thereby create autonumbers) until
user moves on to another record.

Is there a way to force that data to the tables (ie make the new records)
while the user is still on the form?

Yes. Use the AfterUpdate event of one or more of the controls to force a write
to disk. Either

Private Sub controlname_AfterUpdate(Cancel as Integer)
DoCmd.RunCommand acCmdSaveRecord
End Sub

or

Private Sub controlname_AfterUpdate(Cancel as Integer)
If Me.Dirty Then Me.Dirty = False
End Sub


John W. Vinson [MVP]
 
Thank you, that did the trick...

I wonder where one finds this info? I searched Microsofts online Access help
for 'acCmdSaveRecord ' and found nothing. How does one learn the various
commands?
 
Back
Top