Jeremiah31
Programmer
Newbie, I was wondering if an "IF statement" can be included into a select case statement.
This is the original case statement
Dim strSQL As String
Select Case Index
Case 0
strTrailerId = Me.txtTrailerReq 'Set variable to trailer Number
strSQL = "sp_TRNS0004_TrailerTrackHistory_2 '" & strTrailerId & "'"
Case 1
lngReference = Me.txtReference
strSQL = "sp_TRNS0004_TrailerTrackHistoryByReference " & lngReference
Case 2
strBOL = Me.txtBol
strSQL = "sp_TRNS0004_TrailerTrackHistoryByBOL " & strBOL
End Select
Was wondering if something like this is possible:
Select Case Index
Case 0
If Me.txtTrailerReg is Null then
MsgBox("Data Enter error, must enter a Trailer Number before continuing")
Else
strTrailerId = Me.txtTrailerReq 'Set variable to trailer Number
strSQL = "sp_TRNS0004_TrailerTrackHistory_2 '" & strTrailerId & "'"
End IF
When I try to run the application I receive an error 404, How should this be handled?
This is the original case statement
Dim strSQL As String
Select Case Index
Case 0
strTrailerId = Me.txtTrailerReq 'Set variable to trailer Number
strSQL = "sp_TRNS0004_TrailerTrackHistory_2 '" & strTrailerId & "'"
Case 1
lngReference = Me.txtReference
strSQL = "sp_TRNS0004_TrailerTrackHistoryByReference " & lngReference
Case 2
strBOL = Me.txtBol
strSQL = "sp_TRNS0004_TrailerTrackHistoryByBOL " & strBOL
End Select
Was wondering if something like this is possible:
Select Case Index
Case 0
If Me.txtTrailerReg is Null then
MsgBox("Data Enter error, must enter a Trailer Number before continuing")
Else
strTrailerId = Me.txtTrailerReq 'Set variable to trailer Number
strSQL = "sp_TRNS0004_TrailerTrackHistory_2 '" & strTrailerId & "'"
End IF
When I try to run the application I receive an error 404, How should this be handled?