473,416 Members | 1,869 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,416 software developers and data experts.

2 Combo Box Menu from Multiple Query

Hey everyone,

I am having a hell of a time trying to set this menu system up. Here's
what I'm trying to do.

Combo Box One; is populated by names under properties "row source"
"Phase 1" through "Phase 10" (there are 10 Phases I want to sort from)

Once the phase has been selected a second combo box would populate.

So Combo Box 1 = Phase 3 ... Combo Box 2 = A list of people's names in
Phase 3.

I can not requery combo box 2 based on the selection of combo box 1
becuase of the complexity of the query to sort each phase. One table
source and multiple criteria must me met in the query to pass to the
next phase.

Is there a way to set the row source of combo box 2 to a specific query
based on a selection from combo box 1?

So Combo Box 1 = "Phase 1" sets row source of Combo Box 2 = QueryPhase1

I have no VBA experience macro would be the only automation solution
possible on my end.

Any help would be greatly appreciated.

Thanks in advance.

Dec 16 '05 #1
3 3617
Howzabout instead using a multi-level form/subform/sub-subform
structure where the master/child relationship is set on the relation
between the form's 'phase' selector combo and the subform's 'phase'
foreign key?

That way you won't need to requery, the valid cBox2 values would be
filtered based on the relationship.

Similarly, each row of the sub-subform people list would be linked to
the selected record in the subform.

King Ron of Chi

Dec 16 '05 #2
I am not sure what you mean by:
I can not requery combo box 2 based on the selection of combo box 1
becuase of the complexity of the query to sort each phase. One table
source and multiple criteria must me met in the query to pass to the
next phase.
In order to tie the second combo box into the first combo box simply
refer to the first combo by its form field name (i.e. ME.cmbBox1) in
the source string for the second combo.

Here is a workable example (txtTelNo is the second combo, txtCarrier is
the first one):
Private Sub txtTelNo2_GotFocus()
Me.txtTelNo.RowSource = "SELECT First(tblNYUCircuitsServer.txtTelNo2)
AS [Carrier2 Telephone] FROM tblNYUCircuitsServer GROUP BY
tblNYUCircuitsServer.txtTelNo2 HAVING
(((tblNYUCircuitsServer.txtTelNo2) Is Not Null And Not
(tblNYUCircuitsServer.txtTelNo2)='') AND
((First(tblNYUCircuitsServer.txtCarrier2)) Is Not Null And
(First(tblNYUCircuitsServer.txtCarrier2)) LIKE '*" & _
me.txtCarrier & "*') AND
((First(tblNYUCircuitsServer.txtStatus))<>'Header' )) ORDER BY
First(tblNYUCircuitsServer.txtCarrier2),
First(tblNYUCircuitsServer.txtTelNo2);"
End Sub

The first combo box name/variable (i.e. Me.ComboBox1) must be on a
separate line surrounded by single quotes:
Me.ComboBox2.Rowsource = "SELECT Table.Field2 FROM Table WHERE
Table.Field1 = '" & _
Me.ComboBox1 & "';"

hm*****@hartford.edu wrote: Hey everyone,

I am having a hell of a time trying to set this menu system up. Here's
what I'm trying to do.

Combo Box One; is populated by names under properties "row source"
"Phase 1" through "Phase 10" (there are 10 Phases I want to sort from)

Once the phase has been selected a second combo box would populate.

So Combo Box 1 = Phase 3 ... Combo Box 2 = A list of people's names in
Phase 3.

I can not requery combo box 2 based on the selection of combo box 1
becuase of the complexity of the query to sort each phase. One table
source and multiple criteria must me met in the query to pass to the
next phase.

Is there a way to set the row source of combo box 2 to a specific query
based on a selection from combo box 1?

So Combo Box 1 = "Phase 1" sets row source of Combo Box 2 = QueryPhase1

I have no VBA experience macro would be the only automation solution
possible on my end.

Any help would be greatly appreciated.

Thanks in advance.


Dec 16 '05 #3
Hey guys,

Thanks so far for the help except I don't understand VBA, sorry.

However I got it to work through a marco. The macro wasn't allowing me
to use Select, but form your code I noticed that Select needed to be in
"". So thanks for the help guys.

Happy Holidays

Dec 16 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Yuk Cheng | last post by:
<<<start index.htm>>> <html> <head> <script> function perform(action){ } </script> </head>
1
by: Giulio | last post by:
Hello, I have a continuous form with a combo box inside. From the combo box I can pick some values which, by the "after-update" event, change some other combo box values determined by a query....
1
by: Robert Neville | last post by:
The solution to my dilemma seems straight-forward, yet my mind has not been forthcoming with a direct route. My Project form has a tab control with multiple sub-forms; these distinct sub-forms...
2
by: Sean | last post by:
Greetings all, I am attempting to make a form that will filter through several tables that (I believe) have refretial integrity. I am pulling data from several tables into the form and i would...
7
by: Megan | last post by:
Hi everybody- I inherited a database that somehow uses a bound combo box as a record selector. Let me give you some background. The form is based on data from 2 tables. The first table, Person,...
17
by: Aussie Rules | last post by:
Hi, I want to have a single line combo box dropdown, but where i can selected multiple items in the drop down via a check box... I can see one in the standard tool box... is there one ? If...
2
by: visionstate | last post by:
Hi there, I am working on a form that uses 3 text boxes and 3 combo boxes. When any data is entered into any of these, I click a command button and this requeries a sub query in the form and...
3
by: feeman | last post by:
I have a combo field in access 97, which you select customers from, but if you add a new customer into the customer accounts it put them at the bottom of the combo menu. Is there a way to make all...
3
by: emily.a.day | last post by:
I have a book database, and I have set up a query to search by subject. As it is now, the searcher has to know the subject and type it into the query. I wonder if there is a way to have a combo...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.