Hi All
I am slightly perplexed, i m using the below code to do a quick check that data is entered as it should, but it seems to bypass all the if and elseif statements and carries out the else statement regardless...
can anyone offer any thoughts...
Private Sub Command138_Click()
On Error GoTo Err_Command138_Click
Dim stDocName As String
Dim stLinkCriteria As String
If IsNull(Me.Combo102.Value) Then
Me.Label140.Visible = True
Me.Combo102.SetFocus
ElseIf IsNull(Me.DeliveryDetails.Value) Then
Me.Label142.Visible = True
Me.DeliveryDetails.SetFocus
ElseIf IsNull(Me.DeliveryContact.Value) Then
Me.Label143.Visible = True
Me.DeliveryContact.SetFocus
Else
stDocName = "frmSampleStep2"
stLinkCriteria = "[SRNumber]=" & Me![SRNumber]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit Sub
End If
Exit_Command138_Click:
Exit Sub
Err_Command138_Click:
MsgBox Err.Description
Resume Exit_Command138_Click
End Sub
using MS Access 2003 but saved in format for 2000/XP
Ta
Ali
I am slightly perplexed, i m using the below code to do a quick check that data is entered as it should, but it seems to bypass all the if and elseif statements and carries out the else statement regardless...
can anyone offer any thoughts...
Private Sub Command138_Click()
On Error GoTo Err_Command138_Click
Dim stDocName As String
Dim stLinkCriteria As String
If IsNull(Me.Combo102.Value) Then
Me.Label140.Visible = True
Me.Combo102.SetFocus
ElseIf IsNull(Me.DeliveryDetails.Value) Then
Me.Label142.Visible = True
Me.DeliveryDetails.SetFocus
ElseIf IsNull(Me.DeliveryContact.Value) Then
Me.Label143.Visible = True
Me.DeliveryContact.SetFocus
Else
stDocName = "frmSampleStep2"
stLinkCriteria = "[SRNumber]=" & Me![SRNumber]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit Sub
End If
Exit_Command138_Click:
Exit Sub
Err_Command138_Click:
MsgBox Err.Description
Resume Exit_Command138_Click
End Sub
using MS Access 2003 but saved in format for 2000/XP
Ta
Ali