J
Jon
Hi,
I have a form for adding data to a table. In this form , there is a command
button for adding those data and it has the following code:
Private Sub Command22_Click()
On Error GoTo Err_Command22_Click
If IsNull(Me.Combo28) = True Then
MsgBox "You Must Select a S.O.Processor First.", vbCritical, "No Processor
Selected..."
Me.Combo28.SetFocus
ElseIf IsNull(Me.CONTRACT_NO) = True Then
MsgBox "You Must Input a Contract No. First.", vbCritical, "No Contract
No. Input..."
Me.CONTRACT_NO.SetFocus
ElseIf IsNull(Me.CONTRACTOR) = True Then
MsgBox "You Must Input Contractor First.", vbCritical, "No Contractor
Input..."
Me.CONTRACTOR.SetFocus
ElseIf IsNull(Me.Combo33) = True Then
MsgBox "You Must Select a Proponent First.", vbCritical, "No Proponent
Selected..."
Me.Combo33.SetFocus
ElseIf IsNull(Me.Combo30) = True Then
MsgBox "You Must Select a Advisor First.", vbCritical, "No Advisor
Selected..."
Me.Combo30.SetFocus
ElseIf IsNull(Me.TITLE_OF_CONTRACT) = True Then
MsgBox "You Must Input a Title of Contract First.", vbCritical, "No
Contract Title Input..."
Me.TITLE_OF_CONTRACT.SetFocus
ElseIf IsNull(Me.EXPIRY) = True Then
MsgBox "You Must Input an Expiry date First.", vbCritical, "No Expiry
date Input..."
Me.EXPIRY.SetFocus
Else
DoCmd.GoToRecord , , acNewRec
End If
Exit Sub
Exit_Command22_Click:
Exit Sub
Err_Command22_Click:
MsgBox Err.Description
Resume Exit_Command22_Click
End Sub
The code is working , but it works one time, after that, the code does not
work, because it is not asking the user about the combo box. It works with
text box only. Can any body tell me how to correct it?
I have a form for adding data to a table. In this form , there is a command
button for adding those data and it has the following code:
Private Sub Command22_Click()
On Error GoTo Err_Command22_Click
If IsNull(Me.Combo28) = True Then
MsgBox "You Must Select a S.O.Processor First.", vbCritical, "No Processor
Selected..."
Me.Combo28.SetFocus
ElseIf IsNull(Me.CONTRACT_NO) = True Then
MsgBox "You Must Input a Contract No. First.", vbCritical, "No Contract
No. Input..."
Me.CONTRACT_NO.SetFocus
ElseIf IsNull(Me.CONTRACTOR) = True Then
MsgBox "You Must Input Contractor First.", vbCritical, "No Contractor
Input..."
Me.CONTRACTOR.SetFocus
ElseIf IsNull(Me.Combo33) = True Then
MsgBox "You Must Select a Proponent First.", vbCritical, "No Proponent
Selected..."
Me.Combo33.SetFocus
ElseIf IsNull(Me.Combo30) = True Then
MsgBox "You Must Select a Advisor First.", vbCritical, "No Advisor
Selected..."
Me.Combo30.SetFocus
ElseIf IsNull(Me.TITLE_OF_CONTRACT) = True Then
MsgBox "You Must Input a Title of Contract First.", vbCritical, "No
Contract Title Input..."
Me.TITLE_OF_CONTRACT.SetFocus
ElseIf IsNull(Me.EXPIRY) = True Then
MsgBox "You Must Input an Expiry date First.", vbCritical, "No Expiry
date Input..."
Me.EXPIRY.SetFocus
Else
DoCmd.GoToRecord , , acNewRec
End If
Exit Sub
Exit_Command22_Click:
Exit Sub
Err_Command22_Click:
MsgBox Err.Description
Resume Exit_Command22_Click
End Sub
The code is working , but it works one time, after that, the code does not
work, because it is not asking the user about the combo box. It works with
text box only. Can any body tell me how to correct it?