Having a small problem with amessage box. I have a combo box and a button which takes you to another form. When the user clicks on the button I want a message box to appear if the Combo box value is null. This is code im using but its not working correctly, something simple I hope!
Private Sub Command13_Click()
On Error GoTo Err_Command13_Click
If Me.Combo5 = Null Then
MsgBox "Please select an exercise from the list."
Me.Visible = False
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Armour_Selection"
stLinkCriteria = "[Exercise_Name]=" & "'" & Me![Combo5] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Command13_Click:
Exit Sub
DoCmd.Close
Err_Command13_Click:
MsgBox Err.Description
Resume Exit_Command13_Click
End Sub
Private Sub Command13_Click()
On Error GoTo Err_Command13_Click
If Me.Combo5 = Null Then
MsgBox "Please select an exercise from the list."
Me.Visible = False
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Armour_Selection"
stLinkCriteria = "[Exercise_Name]=" & "'" & Me![Combo5] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Command13_Click:
Exit Sub
DoCmd.Close
Err_Command13_Click:
MsgBox Err.Description
Resume Exit_Command13_Click
End Sub