Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Combo Box NULL, Another Combo Box NOT NULL

Status
Not open for further replies.
Mar 9, 2007
48
US
I have a form with two combo boxes. What I'm attempting to do is this:

If Combox A has a certain value I want to make Combox Box B required for entry. The problem is that I'm fairly new to VB and not sure how to make this happen. Any help is much appreciated.

Thanks!
 
In the comboA AfterUpdate event procedure:
If Me![combo A] = "certain value" Then
Me![combo B].Requery
End If

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Private Sub Form_Unload(Cancel As Integer)
If Me.[combo A] = "certain value" and IsNull(Me.[combo b]) Then
Cancel = True
MsgBox "Combo B cannot be left empty!
Me.[combo b].SetFocus
End If

Let them hate - so long as they fear... Lucius Accius
 
How are ya mizenerman . . .
mizenerman said:
[blue]If Combox A has a certain value I want to [purple]make Combox Box B required for entry.[/blue]

Same as [blue]straybullet[/blue] only I'd use the forms [blue]Before Update[/blue] event!

Calvin.gif
See Ya! . . . . . .

Be sure to see FAQ219-2884:
 
Seems I made a mistake, sorry.
Please disregard my post.
 
Thanks Aceman and Stray Bullet. That's exactly what I was needing.

PHV, no worries. You've come thru for me in the past. Your input is much appreciated.

Thanks again everyone!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top