G
Guest
I am trying to use the results of 2 check boxes on an underlying form, when I
select a command box to select the correct macro to use the code I have
created is as followsrivate Sub CmdPayUpdate_Click()
On Error GoTo Err_CmdPayUpdate_Click
Dim stDocName As String
Dim stDocNames As String
Dim stDocNames2 As String
stDocName = "Pay Calculation 2007"
stDocNames = "Pay Calculation 2006 union"
stDocNames2 = "Union Non Skills"
If Me.AAAP_Enrolled = "No" Then
DoCmd.RunMacro stDocName2
Else
If Me.Union_Member = "Yes" Then
DoCmd.RunMacro stDocNames
Else
DoCmd.RunMacro stDocName
End If
End If
Exit_CmdPayUpdate_Click:
Exit Sub
Err_CmdPayUpdate_Click:
MsgBox Err.Description
Resume Exit_CmdPayUpdate_Click
End Sub
however it doesn't seem to work, can anyone help
select a command box to select the correct macro to use the code I have
created is as followsrivate Sub CmdPayUpdate_Click()
On Error GoTo Err_CmdPayUpdate_Click
Dim stDocName As String
Dim stDocNames As String
Dim stDocNames2 As String
stDocName = "Pay Calculation 2007"
stDocNames = "Pay Calculation 2006 union"
stDocNames2 = "Union Non Skills"
If Me.AAAP_Enrolled = "No" Then
DoCmd.RunMacro stDocName2
Else
If Me.Union_Member = "Yes" Then
DoCmd.RunMacro stDocNames
Else
DoCmd.RunMacro stDocName
End If
End If
Exit_CmdPayUpdate_Click:
Exit Sub
Err_CmdPayUpdate_Click:
MsgBox Err.Description
Resume Exit_CmdPayUpdate_Click
End Sub
however it doesn't seem to work, can anyone help