LaRockera02
Registered User.
- Local time
- Today, 06:18
- Joined
- Oct 21, 2011
- Messages
- 83
sorry I don't have that much experience writing code. This is partly what I came up wih. Is there a way I can get rid of this save button and just use New Call. I really appreciate the help
Private Sub Add_Record_Click()
On Error GoTo Err_Add_Record_Click
If Me.cmdSave.Caption = "Save" Then
Me.Add_Record.Caption = "New Call"
' ... Validation code GOES HERE ...
If IsNull(Me.CS_Rep) Then
MsgBox "CS Rep Is Required"
Me.CS_Rep.SetFocus
Else
If IsNull(Me.CALLERS_NAME) Then
MsgBox "Callers Name Is Required"
Me.CALLERS_NAME.SetFocus
Else
If IsNull(Me.Caller_Type) Then
MsgBox "Caller's Type Is Required"
Me.Caller_Type.SetFocus
Else
If IsNull(Me.FOLLOW_UP) Then
MsgBox "Please enter Y or N for Follow Up"
Me.FOLLOW_UP.SetFocus
Else
If IsNull(Me.NOTE1_subform) Then
MsgBox "Note Needed"
Me.NOTE1_subform.SetFocus
Else
End If
End If
End If
End If
End If
End If
End If
End If
If ValidationIsFine Then
' ... Save code here GOES HERE ...
End If
Else
Me.cmdSave.Caption = "Save"
' ... Validation code GOES HERE ...
If ValidationIsFine Then
DoCmd.GoToRecord , , acNewRec
End If
End If
Exit_Add_Record_Click:
Exit Sub
Err_Add_Record_Click:
MsgBox Err.Description
Resume Exit_Add_Record_Click
End Sub
Private Sub Add_Record_Click()
On Error GoTo Err_Add_Record_Click
If Me.cmdSave.Caption = "Save" Then
Me.Add_Record.Caption = "New Call"
' ... Validation code GOES HERE ...
If IsNull(Me.CS_Rep) Then
MsgBox "CS Rep Is Required"
Me.CS_Rep.SetFocus
Else
If IsNull(Me.CALLERS_NAME) Then
MsgBox "Callers Name Is Required"
Me.CALLERS_NAME.SetFocus
Else
If IsNull(Me.Caller_Type) Then
MsgBox "Caller's Type Is Required"
Me.Caller_Type.SetFocus
Else
If IsNull(Me.FOLLOW_UP) Then
MsgBox "Please enter Y or N for Follow Up"
Me.FOLLOW_UP.SetFocus
Else
If IsNull(Me.NOTE1_subform) Then
MsgBox "Note Needed"
Me.NOTE1_subform.SetFocus
Else
End If
End If
End If
End If
End If
End If
End If
End If
If ValidationIsFine Then
' ... Save code here GOES HERE ...
End If
Else
Me.cmdSave.Caption = "Save"
' ... Validation code GOES HERE ...
If ValidationIsFine Then
DoCmd.GoToRecord , , acNewRec
End If
End If
Exit_Add_Record_Click:
Exit Sub
Err_Add_Record_Click:
MsgBox Err.Description
Resume Exit_Add_Record_Click
End Sub