triggers?

  • Thread starter Thread starter jcheah
  • Start date Start date
J

jcheah

Guest
Hi,

Does Access have triggers?

eg. When i insert a new record i want a trigger that populates the date and time (sysdate?) that it was inserted. and also populate some other tables.

I am also trying to create a trigger that puts the sysdate into a 'Last_Updated' column whenever a record is updated....

thanks!

Jon Cheah
 
Jon,

Access doesn't have triggers like ORACLE & SQL Server.

You can't bind code to the data. All "control" is enforced with form events.

In your case, you can use a form's BeforeInsert event to put:

Me.YourDateTimeField = Now()

you could also use no event at all and just set its DefaultValue to Now()

The form/control events are pretty powerful, but you can't enforce any
control over your data by binding "triggers" to it. Only through forms.

Wayne
 
Thanks Wayne!

Much appreciated :)
 
If you only care about when a new record was created you could add a new field to your table and set it's default value to =Now()
 

Users who are viewing this thread

Back
Top Bottom