Flag Up when an entry is made in a field.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Can I, say automatically send a email, if a entry is made in a specific
field. ie if a user checks the urgent tick box?
 
Access lacks triggers, so you cannot do this at the engine level. But if the
entries are made in forms, you can use the events of the form to achieve
this.

Use the AfterUpdate event of the form to examine your IsUrgent field. To
know if it changed, you need to look at the OldValue of the control, but
that's not available in Form_AfterUpdate, so you will need to use a
form-level variable and assign it in Form_BeforeUpdate.

1. In the General Declarations section of the form's module (at the top,
with the Option statements), add this line:
Dim bChangedToUrgent As Boolean

2. In the BeforeUpdate event of the form:
bChangedToUrgent = False
If Me.IsUrgent.OldValue Then
'do nothing
ElseIf (Me.IsUrgent.Value) Then
bChangedToUrgent = True
End If

3. In the AfterUpdate event of the form:
If bChangedToUrgent Then
DoCmd.SendObject acSendNoObject, ...
End If
 

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