Working with Access:
and the following is my problem:
ElseIf Tip.text = "" Then <---------------Something abut this line here...
MsgBox "Please Enter a Tip"
Me.Tip.SetFocus
I change the code using the value property. I dont get the error msg. However, it skips the Then MsgBox "Please Enter a Tip" portion.
ElseIf Tip.Value = "" Then
MsgBox "Please Enter a Tip
Me.Tip.SetFocus
I then tested by doing the following....
If Tip.Value = "" Then <----Placed this on watch... and it does state Tip.Value = Null
MsgBox "Please Enter a Tip" <----However, this part is skipped
Me.Tip.SetFocus
Else: MsgBox "What Happen" <----And it does display this msg box
End If
The actual lines of code are the follwoing:
Private Sub Command11_Click()
On Error GoTo Err_Command11_Click
ElseIf Name1.ListIndex = -1 Then
MsgBox "Please select a Name"
Me.Name1.SetFocus
Exit Sub
ElseIf Tip_Type.ListIndex = -1 Then
MsgBox "Please Select a Tip Type"
Me.Tip_Type.SetFocus
Exit Sub
ElseIf Tip.Value = "" Then
MsgBox "Please Enter a Tip"
Me.Tip.SetFocus
Exit Sub
End If
DoCmd.GoToRecord , , acNext
Exit_Command11_Click:
Exit Sub
Err_Command11_Click:
MsgBox Err.Description
Resume Exit_Command11_Click
End Sub
Tony813
and the following is my problem:
ElseIf Tip.text = "" Then <---------------Something abut this line here...
MsgBox "Please Enter a Tip"
Me.Tip.SetFocus
I change the code using the value property. I dont get the error msg. However, it skips the Then MsgBox "Please Enter a Tip" portion.
ElseIf Tip.Value = "" Then
MsgBox "Please Enter a Tip
Me.Tip.SetFocus
I then tested by doing the following....
If Tip.Value = "" Then <----Placed this on watch... and it does state Tip.Value = Null
MsgBox "Please Enter a Tip" <----However, this part is skipped
Me.Tip.SetFocus
Else: MsgBox "What Happen" <----And it does display this msg box
End If
The actual lines of code are the follwoing:
Private Sub Command11_Click()
On Error GoTo Err_Command11_Click
ElseIf Name1.ListIndex = -1 Then
MsgBox "Please select a Name"
Me.Name1.SetFocus
Exit Sub
ElseIf Tip_Type.ListIndex = -1 Then
MsgBox "Please Select a Tip Type"
Me.Tip_Type.SetFocus
Exit Sub
ElseIf Tip.Value = "" Then
MsgBox "Please Enter a Tip"
Me.Tip.SetFocus
Exit Sub
End If
DoCmd.GoToRecord , , acNext
Exit_Command11_Click:
Exit Sub
Err_Command11_Click:
MsgBox Err.Description
Resume Exit_Command11_Click
End Sub
Tony813