Joshua61679
Technical User
I've got a form with 3 fields, all combo boxes: cmbType, cmbSupplier and cmbPart. I currently have cmbSupplier dependant upon cmbType. I'd like to make cmbPart dependant upon both cmbType and cmbSupplier. I have a query set up, but I'm not sure how to code it. My code to make cmbSupplier dependant is:
I'm not sure how to convert this to make it work to check two combo boxes at once though. I've tried just doubling it and making the neccessary nominclature changes:
I had little hope that this would work, and it doesn't. I seems to only work to check the first part (cmbSupplier). Any help would be much appreciated.
-Josh
Code:
Private Sub cmbSupplier_GotFocus()
If Len(Trim(Nz(cmbType, "") & "")) = 0 Then
MsgBox "Please Specify Type First"
cmbType.SetFocus
Else
cmbSupplier.Requery
End If
End Sub
Code:
Private Sub cmbPart_GotFocus()
If Len(Trim(Nz(cmbSupplier, "") & "")) = 0 Then
MsgBox "Please Specify Supplier First"
cmbSupplier.SetFocus
Else
cmbPart.Requery
End If
If Len(Trim(Nz(cmbType, "") & "")) = 0 Then
MsgBox "Please Specify Type First"
cmbType.SetFocus
Else
cmbPart.Requery
End If
End Sub
-Josh