Hi,
I have a form with the intent that users will enter/select data from various text & combo boxes to update a specific table.
I created a button with an "On Click" event that is intended to update the table when clicked and then clear the form.
It was working fine, until I added code to create custom message boxes when certain fields were left blank. All other functionality of the form is working fine (message boxes, etc.) but it no longer updates the table.
I need some help with the coding to update the table and clear the form once the "Enter" button is clicked. Again, everything else is working fine.
Here's the code as it exits currently:
Option Compare Database
Private Sub cboEmpID_Change()
Me.txtLegalName.Value = Me.cboEmpID.Column(1)
Me.txtDOH.Value = Me.cboEmpID.Column(2)
Me.txtLocation.Value = Me.cboEmpID.Column(3)
Me.txtMgr.Value = Me.cboEmpID.Column(4)
Me.txtHRBP.Value = Me.cboEmpID.Column(5)
End Sub
Private Sub cbo_EmpID_Change()
End Sub
Private Sub NextRecord_Click()
If Nz(Me.txtDateIssued, "") = "" Then
MsgBox "Date Issued is a required field", vbInformation, ""
Exit Sub
End If
If Nz(Me.Combo45, "") = "" Then
MsgBox "CA/PIP Level is a required field", vbInformation, ""
Exit Sub
End If
If Nz(Me.Combo33, "") = "" Then
MsgBox "Reason is a required field", vbInformation, ""
Exit Sub
End If
If Nz(Me.Combo37, "") = "" Then
MsgBox "HR Advisor is a required field", vbInformation, ""
Exit Sub
End If
End Sub
Private Sub Form_BeforeUpdate(Cancel As Integer)
End Sub
I have a form with the intent that users will enter/select data from various text & combo boxes to update a specific table.
I created a button with an "On Click" event that is intended to update the table when clicked and then clear the form.
It was working fine, until I added code to create custom message boxes when certain fields were left blank. All other functionality of the form is working fine (message boxes, etc.) but it no longer updates the table.
I need some help with the coding to update the table and clear the form once the "Enter" button is clicked. Again, everything else is working fine.
Here's the code as it exits currently:
Option Compare Database
Private Sub cboEmpID_Change()
Me.txtLegalName.Value = Me.cboEmpID.Column(1)
Me.txtDOH.Value = Me.cboEmpID.Column(2)
Me.txtLocation.Value = Me.cboEmpID.Column(3)
Me.txtMgr.Value = Me.cboEmpID.Column(4)
Me.txtHRBP.Value = Me.cboEmpID.Column(5)
End Sub
Private Sub cbo_EmpID_Change()
End Sub
Private Sub NextRecord_Click()
If Nz(Me.txtDateIssued, "") = "" Then
MsgBox "Date Issued is a required field", vbInformation, ""
Exit Sub
End If
If Nz(Me.Combo45, "") = "" Then
MsgBox "CA/PIP Level is a required field", vbInformation, ""
Exit Sub
End If
If Nz(Me.Combo33, "") = "" Then
MsgBox "Reason is a required field", vbInformation, ""
Exit Sub
End If
If Nz(Me.Combo37, "") = "" Then
MsgBox "HR Advisor is a required field", vbInformation, ""
Exit Sub
End If
End Sub
Private Sub Form_BeforeUpdate(Cancel As Integer)
End Sub