soupisgood84
Technical User
I get results but not the kind I want.
I have a form with a checkbox in it. If the box is checked, I want to go to another form; if not, I want the code to continue. I naturally used a If Then Else loop, but I must have overlooked something. Please Help. Thanks in advance.
I have a form with a checkbox in it. If the box is checked, I want to go to another form; if not, I want the code to continue. I naturally used a If Then Else loop, but I must have overlooked something. Please Help. Thanks in advance.
Code:
Private Sub cmdSubmit_Click()
'This prevents the user to continue unless all fields are completed
DoCmd.GoToRecord , , acNext
Dim stDocName As String
stDocName = "frmReceiving(PrintOut)"
Dim stCheckforLabel As Integer
stCheckforLabel = [Forms]![frmExpense-Receiving]![CheckforLabel]
If stCheckforLabel = Null Then
GoTo subform1
Else
DoCmd.OpenForm stDocName
Exit Sub
End If
subform1:
Dim LResponse As Integer
LResponse = MsgBox(" Data Entered Successfully ", vbOKOnly, "Notice")
Exit Sub