A
Anne
I am using a form which shows the user the last date of the
YearToDatePayroll and the current week payroll. The user has to decide if
the Current Week has already been updated to the Year to Date table and if
or not to run the update macro. But they keep duplicating the updates.
Now, I have created invisible textboxes, which analysis the dates and if the
table Year to Date show the same date as the current week, I would like to
force the macro to abort.
I inserted the 2nd to 4th line into the run macro command, which is supposed
to do: if LinkResults = 1, give message and exit, if LinkResults =2, giv
messagen and continue to run the macro.
My trials, of course, do not work. Is it possible to make it work?
Thanks,
Anne
Private Sub Update25_Click()
IIf LinkResults = 1, MsgBox("Already Updated")
GoTo Exit_Update25_Click
IIf LinkResults = 2, MsgBox("Table Will be Updates")
On Error GoTo Err_Update25_Click
Dim stDocName As String
stDocName = "ApendCurrentWeekMacro"
DoCmd.RunMacro stDocName
Exit_Update25_Click:
Exit Sub
Err_Update25_Click:
MsgBox Err.Description
Resume Exit_Update25_Click
End Sub
YearToDatePayroll and the current week payroll. The user has to decide if
the Current Week has already been updated to the Year to Date table and if
or not to run the update macro. But they keep duplicating the updates.
Now, I have created invisible textboxes, which analysis the dates and if the
table Year to Date show the same date as the current week, I would like to
force the macro to abort.
I inserted the 2nd to 4th line into the run macro command, which is supposed
to do: if LinkResults = 1, give message and exit, if LinkResults =2, giv
messagen and continue to run the macro.
My trials, of course, do not work. Is it possible to make it work?
Thanks,
Anne
Private Sub Update25_Click()
IIf LinkResults = 1, MsgBox("Already Updated")
GoTo Exit_Update25_Click
IIf LinkResults = 2, MsgBox("Table Will be Updates")
On Error GoTo Err_Update25_Click
Dim stDocName As String
stDocName = "ApendCurrentWeekMacro"
DoCmd.RunMacro stDocName
Exit_Update25_Click:
Exit Sub
Err_Update25_Click:
MsgBox Err.Description
Resume Exit_Update25_Click
End Sub