Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / New Users / June 2006

Tip: Looking for answers? Try searching our database.

Basing One Combo Box on Another--Question

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Christian ><> - 06 Jun 2006 15:15 GMT
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...
Klatuu - 06 Jun 2006 16:19 GMT
This site may be useful to you:

http://www.mvps.org/access/forms/frm0043.htm

It addresses adding "ALL" to a combo, but also explains when you can use Null

> Okay, I got my combo boxes to be limited by what is entered in another and
> used the following code:
[quoted text clipped - 8 lines]
> 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...
Christian ><> - 06 Jun 2006 16:46 GMT
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 site may be useful to you:
>
[quoted text clipped - 14 lines]
> > 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...
Christian ><> - 06 Jun 2006 16:53 GMT
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?

> This site may be useful to you:
>
[quoted text clipped - 14 lines]
> > 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...
Klatuu - 06 Jun 2006 16:57 GMT
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

> This may be relevant.
>
[quoted text clipped - 28 lines]
> > > 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...
Christian ><> - 06 Jun 2006 17:10 GMT
AWESOME!  You are so totally my HERO!  Thanks bro!

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

> Me.Insurance_Contact = Me.Insurance_Contact.ItemData(0)
>
[quoted text clipped - 35 lines]
> > > > 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...
Klatuu - 06 Jun 2006 17:13 GMT
yes

> AWESOME!  You are so totally my HERO!  Thanks bro!
>
[quoted text clipped - 39 lines]
> > > > > 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...
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.