I tried the code, but it did nothing. I tried this code and it didn't work
either.
Both fields are bound controls. Combo187 is bound to Paid Salesman and
Combo6 is bound to Employee.
What else can I try ?
Thanks,
Dave
If Me.Combo187.Value = "True" And _
IsNull([Combo6]) Then
MsgBox "You must select a Sales Person."
Cancel = True
Me.Combo6.SetFocus
End If
Ken Snell said:
Sorry...I did misunderstand!
Assuming that you want to "move" the focus to Combo6 in this instance, I'd
use the form's BeforeUpdate event to trap this error:
Private Sub Form_BeforeUpdate(Cancel As Integer)
If Me.Combo187.Value = "True" And _
Len(Me.Combo6.Value & "") = 0 Then
MsgBox "You must select a salesman."
Cancel = True
Me.Combo6.SetFocus
End If
End Sub
--
Ken Snell
<MS ACCESS MVP>
I probably didn't explain, or either I dont understand.
I want the Combo187 which lets you choose either true or false if the
salesperson has been paid or not.
When the answer is true I want it tell me , hey you haven't chosen a
salesperson and not let me proceed without a salesperson being chosen.
The salesperson comes from the control Combo6.
The format of combo187 is True/False
The format of combo6 is blank
Thanks,
Dave
Sure. Try using the AfterUpdate event of the Combo6 control to
test
the
value of Combo6, and then disable the Combo187 control if Combo6 = True
(assuming that Combo6 is using a boolean format):
Private Sub Combo6_AfterUpdate()
Me.Combo187.Enabled = Not Me.Combo6.Value
End Sub
If Combo6 is using a text format then this should work:
Private Sub Combo6_AfterUpdate()
Me.Combo187.Enabled = (Me.Combo6.Value = "False")
End Sub
--
Ken Snell
<MS ACCESS MVP>
I have a form that has a salesperson drop down list and a salesperson
paid,
true or false on it.
I would like to be able to have it not let or ask me for a salesperson
when
I choose to mark the salesperson as paid.
The two controls are Combo187 which has a value of true or false that
I
choose when paying a salesperson.
The other control is Combo6 which shows a list of salespersons.
Can I do this ?
Thanks,
Dave