D
Don
I have a table that acts as a timer to update data early in the morning. Once
runs, it puts a date in a table to indicate that the procedure has or has not
been triggered that day. This form is working but I have found that it does
not indicate that the macro that it triggers was actually successfully run.
Only that it was triggered. I would like the code if possible to tell if the
macro was successfully run. One possibility would be to add another field to
the table that holds the date to indicate say a 1 if successful and a 0 of
not successful. I think I can achieve this by adding an If......Then
statement. I can write a simple If...Then like the following addressing the
value of fields in a form;
If Not IsNull(Address) And IsNull(PostalCode) Then
MsgBox "You must enter a postal code.", vbExclamation
PostalCode.SetFocus 'Go back to PostalCode field.
Cancel = True 'Cancel saving the record.
End If
But this code is in a Message Box I created. How can I identify the message
boxes created by access; I don't know what their names are. I think I can
turn off the Messages boxes and have them all be answered affirmatively each
time the queries run. If that is the best option, then I need to know what
code could I use to insure all of the queries in the macro finished without
an error.
The code I am running is:
Private Sub Form_Timer()
Dim stDocName As String
If Time() > #6:30:00 AM# Then
If DLookup("LastTimerDate", "tblTimerDate") < DATE Then
stDocName = "Append & Update Linked Tables to Me tables"
DoCmd.RunMacro stDocName
CurrentDb.Execute _
"UPDATE tblTimerDate SET LastTimerDate = " & _
Format(DATE, "\#mm/dd/yyyy\#")
End If
End If
End Sub
How should I address this issue?
Thanks,
Dennis
runs, it puts a date in a table to indicate that the procedure has or has not
been triggered that day. This form is working but I have found that it does
not indicate that the macro that it triggers was actually successfully run.
Only that it was triggered. I would like the code if possible to tell if the
macro was successfully run. One possibility would be to add another field to
the table that holds the date to indicate say a 1 if successful and a 0 of
not successful. I think I can achieve this by adding an If......Then
statement. I can write a simple If...Then like the following addressing the
value of fields in a form;
If Not IsNull(Address) And IsNull(PostalCode) Then
MsgBox "You must enter a postal code.", vbExclamation
PostalCode.SetFocus 'Go back to PostalCode field.
Cancel = True 'Cancel saving the record.
End If
But this code is in a Message Box I created. How can I identify the message
boxes created by access; I don't know what their names are. I think I can
turn off the Messages boxes and have them all be answered affirmatively each
time the queries run. If that is the best option, then I need to know what
code could I use to insure all of the queries in the macro finished without
an error.
The code I am running is:
Private Sub Form_Timer()
Dim stDocName As String
If Time() > #6:30:00 AM# Then
If DLookup("LastTimerDate", "tblTimerDate") < DATE Then
stDocName = "Append & Update Linked Tables to Me tables"
DoCmd.RunMacro stDocName
CurrentDb.Execute _
"UPDATE tblTimerDate SET LastTimerDate = " & _
Format(DATE, "\#mm/dd/yyyy\#")
End If
End If
End Sub
How should I address this issue?
Thanks,
Dennis