Which event to use?

  • Thread starter Thread starter carlee
  • Start date Start date
C

carlee

Hi there,

I am just full of questions today.

What is the best event to use such that, as soon as data
is entered in ANY field on the form, the record is saved
to the table.

I am interested in this using Access 97, for a multiuser
environment.

Many thanks,
Carlee
 
Hi Carlee,

My name is Dennis Schmidt. Thank you for using the Microsoft Windows
Installer Newsgroups.

You would need to place code on each of the form controls. Using the
"OnExit" would probably be as good as any.

I hope this helps! If you have additional questions on this topic, please
reply to this posting.

Need quick answers to questions like these? The Microsoft Knowledge Base
provides a wealth of information that you can use to troubleshoot a problem
or answer a question! It's located at
http://support.microsoft.com/support/c.asp?M=F>.

This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use. © 2001 Microsoft Corporation. All rights
reserved.

Regards,
Dennis Schmidt
Microsoft Support
 
carlee said:
Hi there,

I am just full of questions today.

What is the best event to use such that, as soon as data
is entered in ANY field on the form, the record is saved
to the table.

I am interested in this using Access 97, for a multiuser
environment.

Many thanks,
Carlee


The Before Update event of the form should fire when you manually
change the data in a Control. So, in the Form's Before Update event,
put the following single line of code:

If Me.Dirty = True Then Me.Dirty = False

to save the record.

hth

Hugh
 
Hi there,

I am just full of questions today.

What is the best event to use such that, as soon as data
is entered in ANY field on the form, the record is saved
to the table.

THe AfterUpdate event of *each and every* control for which you wish
this behavior to trigger.

Private Sub txtXYZ_AfterUpdate()
If Me.Dirty = True Then
Me.Dirty = False
End If
End Sub
 
<chuckle> Three experts... three solutions. And they'll all work.

"There are nine and ninety ways
Of constructing tribal lays
And EVERY SINGLE ONE OF THEM IS RIGHT!" - Kipling
 
Back
Top