G
Guest
I run a mcro on a 'on click' event from a button within a form the code is
attached below. It is designed to transfer records from one table to another.
The message appears , so the if then statement is being executed.
Private Sub Command1_Click()
On Error GoTo Err_Command1_Click
Dim stDocName As String
stDocName = "archive data"
If (Me.[Yesoption]) And Me.Text7 = -1 And Me.[Batch to archive] > 0 Then
MsgBox ("Archiving ALL batch Details")
DoCmd.RunMacro ("Archive Data")
End If
Exit_Command1_Click:
Exit Sub
Err_Command1_Click:
MsgBox Err.Description
Resume Exit_Command1_Click
End Sub
The macro works fine when run as a standalone' macro, but when I execute it
from within the form environment, the macro does not do anything.
attached below. It is designed to transfer records from one table to another.
The message appears , so the if then statement is being executed.
Private Sub Command1_Click()
On Error GoTo Err_Command1_Click
Dim stDocName As String
stDocName = "archive data"
If (Me.[Yesoption]) And Me.Text7 = -1 And Me.[Batch to archive] > 0 Then
MsgBox ("Archiving ALL batch Details")
DoCmd.RunMacro ("Archive Data")
End If
Exit_Command1_Click:
Exit Sub
Err_Command1_Click:
MsgBox Err.Description
Resume Exit_Command1_Click
End Sub
The macro works fine when run as a standalone' macro, but when I execute it
from within the form environment, the macro does not do anything.