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.

Sync Multiple Combo Boxes

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Christian ><> - 06 Jun 2006 18:02 GMT
I have four Combo Boxes:
Customers, Contacts, Project Managers, and Superintendents

The other three Combo Box values are based on what is selected in Customers
using a SQL statement.  For example The Contancts SQL statement is:

SELECT [Customer Contacts Table].CC_CustomerContactID, [Customer Contacts
Table].[CC_Contact Person], [Customer Contacts Table].CC_Company FROM
[Customer Contacts Table] WHERE ((([Customer Contacts
Table].CC_Company)=Forms![Job Work Order Form]!Customer)) ORDER BY [Customer
Contacts Table].[CC_Contact Person];

I know that I need code in the Customers Field.  This is what I have:

Private Sub Customer_AfterUpdate()
   Me.Contact_Person = Null
   Me.Contact_Person.Requery
   Me.Contact_Person = Null
End Sub

How can I alter the code to requery all three fields instead of just the
one?  I tried adding more After Event Codes using the other field names and
the computer exploded! :)
Christian ><> - 06 Jun 2006 18:06 GMT
I'm a dork...

I changed my code to this and it appears to work:

Private Sub Customer_AfterUpdate()
   Me.Contact_Person = Null
   Me.Contact_Person.Requery
   Me.Contact_Person = Null
   Me.Project_Manager = Null
   Me.Project_Manager.Requery
   Me.Project_Manager = Null
   Me.Project_Superintendent = Null
   Me.Project_Superintendent.Requery
   Me.Project_Superintendent = Null
End Sub

If one of the pros could confirm though, that would be great!

> I have four Combo Boxes:
> Customers, Contacts, Project Managers, and Superintendents
[quoted text clipped - 19 lines]
> one?  I tried adding more After Event Codes using the other field names and
> the computer exploded! :)
Klatuu - 06 Jun 2006 18:30 GMT
You don't the to set the value of the combos to null before the requeries,
only after and only if you want them empty after the requery.  Other than
that, you got it.

> I'm a dork...
>
[quoted text clipped - 37 lines]
> > one?  I tried adding more After Event Codes using the other field names and
> > the computer exploded! :)
Christian ><> - 06 Jun 2006 18:32 GMT
K.  Thanks again!

> You don't the to set the value of the combos to null before the requeries,
> only after and only if you want them empty after the requery.  Other than
[quoted text clipped - 41 lines]
> > > one?  I tried adding more After Event Codes using the other field names and
> > > the computer exploded! :)
 
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.