O
Olu Solaru
I have a form that has the following command buttons, submit, retry, close,
and combo boxes.
After selecting my options from the combo box, and hit the submit button, I
get the following error message: Compile Error - Label not defined.
I have looked at my coding and can't seem to find anything wrong.
Here is my code:
Private Sub cmdSubmit_Click()
On Error GoTo Err_cmdsubmit_Click
Dim rstOrder As ADODB.Recordset
Set rstOrder = New ADODB.Recordset
rstOrder.Open "tblBprNumber", CurrentProject.Connection, adOpenStatic,
adLockOptimistic
If rstOrder.Supports(adAddNew) Then
With rstOrder
.AddNew
.Fields("BprNumber") = txtBPRNumber
.Fields("LotNumber") = txtLotNumber
.Fields("Sop1") = cboSop1
.Fields("Sop2") = cboSop2
.Fields("Sop3") = cboSop3
.Fields("Sop4") = cboSop4
.Fields("Sop5") = cboSop5
.Fields("Sop6") = cboSop6
.Fields("Sop7") = cboSop7
.Fields("Sop8") = cboSop8
.Fields("Sop9") = cboSop9
.Fields("Sop10") = cboSop10
.Fields("Sop11") = cboSop11
.Fields("Sop12") = cboSop12
.Fields("Sop13") = cboSop13
.Fields("Sop14") = cboSop14
.Fields("Sop15") = cboSop15
.Fields("Sop16") = cboSop16
.Update
cmdReset_Click
End With
End If
rstOrder.Close
Set rstOrder = Nothing
DoCmd.Close
Exit_cmbSubmit_Click:
Exit Sub
Err_cmbSubmit_Click:
MsgBox Err.Description
Resume Exit_cmbSubmit_Click
End Sub
and combo boxes.
After selecting my options from the combo box, and hit the submit button, I
get the following error message: Compile Error - Label not defined.
I have looked at my coding and can't seem to find anything wrong.
Here is my code:
Private Sub cmdSubmit_Click()
On Error GoTo Err_cmdsubmit_Click
Dim rstOrder As ADODB.Recordset
Set rstOrder = New ADODB.Recordset
rstOrder.Open "tblBprNumber", CurrentProject.Connection, adOpenStatic,
adLockOptimistic
If rstOrder.Supports(adAddNew) Then
With rstOrder
.AddNew
.Fields("BprNumber") = txtBPRNumber
.Fields("LotNumber") = txtLotNumber
.Fields("Sop1") = cboSop1
.Fields("Sop2") = cboSop2
.Fields("Sop3") = cboSop3
.Fields("Sop4") = cboSop4
.Fields("Sop5") = cboSop5
.Fields("Sop6") = cboSop6
.Fields("Sop7") = cboSop7
.Fields("Sop8") = cboSop8
.Fields("Sop9") = cboSop9
.Fields("Sop10") = cboSop10
.Fields("Sop11") = cboSop11
.Fields("Sop12") = cboSop12
.Fields("Sop13") = cboSop13
.Fields("Sop14") = cboSop14
.Fields("Sop15") = cboSop15
.Fields("Sop16") = cboSop16
.Update
cmdReset_Click
End With
End If
rstOrder.Close
Set rstOrder = Nothing
DoCmd.Close
Exit_cmbSubmit_Click:
Exit Sub
Err_cmbSubmit_Click:
MsgBox Err.Description
Resume Exit_cmbSubmit_Click
End Sub