Basing One Combo Box on Another--Question

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Okay, I got my combo boxes to be limited by what is entered in another and
used the following code:

Private Sub Insurance_Company_AfterUpdate()
Me.Insurance_Contact = Null
Me.Insurance_Contact.Requery
Me.Insurance_Contact = Me.Insurance_Contact.ItemData(0)
End Sub

Problem--It works, except when I choose a value in the first combo box (the
one that limits the others), the others fill in with the first value instead
of remaining blank. I want them to stay blank until I click on them...
 
That didn't work...

Here is my SQL statement:

SELECT [Insurance Contacts Table].IC_InsuranceContactID, [Insurance Contacts
Table].IC_Contact, [Insurance Contacts Table].[IC_Insurance Company] FROM
[Insurance Contacts Table] WHERE ((([Insurance Contacts Table].[IC_Insurance
Company])=Forms![Job Work Order Form]![Insurance Company])) ORDER BY
[Insurance Contacts Table].IC_Contact;

Based on that site I tried entering the following into the above statement

UNION Select Null as AllChoice, "(All)" as Bogus From [Insurance Contacts
Table]

I tried it in two places: first before the ORDER BY and then before the
WHERE. Eitehr way, my combo box had no selections when I clicked on it in
the form
 
This may be relevant.

The Combo Box (Insurance Company) that limits this Combo Box (Insurance
Contact) has this Event Code entered:

Private Sub Insurance_Company_AfterUpdate()
Me.Insurance_Contact = Null
Me.Insurance_Contact.Requery
Me.Insurance_Contact = Me.Insurance_Contact.ItemData(0)
End Sub

Is there something I can add to this code to make the Insurance Contact
blank until I select it?
 
Me.Insurance_Contact = Me.Insurance_Contact.ItemData(0)

Try using your original SQL without the additions and changing the above
line to

Me.Insurance_Contact = Null
 
AWESOME! You are so totally my HERO! Thanks bro!

Hey is Klatuu from KLATTUU, BARATTA, NICTO? Great flick.
 
Back
Top