473,320 Members | 1,979 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,320 software developers and data experts.

limit two combo boxes with unrelated data??

I read about limiting combo boxes' list data, for example, limiting the
list of values in the second combo based on values in the first combo,
and I found the Dev Ashish site link.

I have two combos based on lookups of very small tables, Audit
Descriptions and Programs.

Combo 1: Audit Descriptions has Comprehensive, Fire Safety, Medical,
MSC, Snapshot.
Combo 2: Programs has A, B, C, D, E, F, G, H (for example).

Not every single program can get all the different kinds of audit
descriptions.
For example Program A can have all five kinds of audits, Program B can
only have Comprehensive or Fire Safety, Program C can only have
Comprehensive or Medical, Program D can only have all but Snapshot,
etc. etc.

It can also be expressed the other way, for example, Comprehensive can
be for Program A, B, C, but not D, etc. etc.

Is there any way with this information I can limit the list of Combo 2
based on Combo 1??

Is it better to ask the end user for the program first, then limit the
audit descriptions??

Should I write code in Combo 2 AfterUpdate event to examine the program
to audit description correlation??

Should I add fields to the lookup tables to facilitate the combo box
filtering??

tblAuditDescriptions has:
Comprehensive
Fire Safety
Medical
MSC
Snapshot

tblPrograms has:
A Apple
B Boy
C Cat
D Dog
E Egg
F Fur
G Games
H Hats

Thank you, Tom

Feb 21 '06 #1
4 1903
You'd need to introduce a 3rd table that indicates which programs are valid
for each Audit Description.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)
"tlyczko" <tl*****@gmail.com> wrote in message
news:11**********************@g14g2000cwa.googlegr oups.com...
I read about limiting combo boxes' list data, for example, limiting the
list of values in the second combo based on values in the first combo,
and I found the Dev Ashish site link.

I have two combos based on lookups of very small tables, Audit
Descriptions and Programs.

Combo 1: Audit Descriptions has Comprehensive, Fire Safety, Medical,
MSC, Snapshot.
Combo 2: Programs has A, B, C, D, E, F, G, H (for example).

Not every single program can get all the different kinds of audit
descriptions.
For example Program A can have all five kinds of audits, Program B can
only have Comprehensive or Fire Safety, Program C can only have
Comprehensive or Medical, Program D can only have all but Snapshot,
etc. etc.

It can also be expressed the other way, for example, Comprehensive can
be for Program A, B, C, but not D, etc. etc.

Is there any way with this information I can limit the list of Combo 2
based on Combo 1??

Is it better to ask the end user for the program first, then limit the
audit descriptions??

Should I write code in Combo 2 AfterUpdate event to examine the program
to audit description correlation??

Should I add fields to the lookup tables to facilitate the combo box
filtering??

tblAuditDescriptions has:
Comprehensive
Fire Safety
Medical
MSC
Snapshot

tblPrograms has:
A Apple
B Boy
C Cat
D Dog
E Egg
F Fur
G Games
H Hats

Thank you, Tom

Feb 21 '06 #2
Hello Doug...
Ugh, I was afraid of this. :( :)
Actually maybe I can add another column into the Audit Description
table, called Program, which would contain one program item per
description, and just have a two-column primary key in that table, use
a distinct value type of query for the first lookup, then use a query
on Audit Description to feed in the second set of values for the second
combo box.
Or alternatively to the Programs table, I'll see what happens, I first
have to have people tell me which Audit Descriptions go with which
Programs.
Thank you, Tom

Feb 21 '06 #3
"tlyczko" <tl*****@gmail.com> wrote in
news:11**********************@g43g2000cwa.googlegr oups.com:
Hello Doug...
Ugh, I was afraid of this. :( :)
Actually maybe I can add another column into the Audit
Description table, called Program, which would contain one
program item per description, and just have a two-column
primary key in that table, use a distinct value type of query
for the first lookup, then use a query on Audit Description to
feed in the second set of values for the second combo box.
Or alternatively to the Programs table, I'll see what happens,
I first have to have people tell me which Audit Descriptions
go with which Programs.
Thank you, Tom
NO! A Big Emphatic NO! What you describe is creating the third
table, then adding the fields from the Audit Descriptions table,
then deletingg your audit descriptions table

It will be a pain to add or remove AUDIT-Program combinations.

Just keep your two tables, and add the third with only two
columns, Audit ID and Program ID.

You originally asked some questions
Is there any way with this information I can limit the list of
Combo 2 based on Combo 1??
Yes, use a third table, programsAudits which contains only the
primary keys of your other two tables.
Is it better to ask the end user for the program first, then
limit the audit descriptions??
If you use the third table, this question becomes irrelevant as
it is equally easy to do either one first.
Should I write code in Combo 2 AfterUpdate event to examine ?
the program to audit description correlation??
No, you just need to replace the rowsource in one combobox with
a query that uses your table and the third table.
Should I add fields to the lookup tables to facilitate the
combo box filtering??


The additional fields required are in the third table. Use a
query to make the two tables appear as a virtual table.

--
Bob Quintal

PA is y I've altered my email address.
Feb 22 '06 #4
Hello Bob,
Thank you for replying.
Once I know which programs go with which Audit Descriptions (other
people have to tell me this), I can use your idea and query the third
table to generate the second combo box based on the value of the first
combo box.
Thank you, Tom

Feb 24 '06 #5

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

Similar topics

3
by: vgrssrtrs | last post by:
<html> <head> <script language="JavaScript"> <!-- /* *** Multiple dynamic combo boxes *** by Mirko Elviro, 9 Mar 2005 *** ***Please do not remove this comment
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...
0
by: Andrew | last post by:
Hello, I am trying to create a chart whose underlying query is linked to 2 combo boxes on the same form. I want to pass the values from the combo boxes into the chart query to allow the chart...
4
by: meganrobertson22 | last post by:
Hi Everyone- I have a question about how to add and then use the "All" selection in a combo box. I am trying to figure out how to: (1) add "All" as a selection to a combo box and then (2)...
4
Rabbit
by: Rabbit | last post by:
Cascading Combo/List Boxes This tutorial is to guide you in the creation of Cascading combo/list boxes. That is when you have multiple combo/list boxes where the selection of an option in one...
4
by: Dave | last post by:
I wasn't sure how to search for previous posts about this, it felt real specific. Ok so here's the database & problem: I have 4 combo boxes: cboServer, cboPolicy, cboDB, and cboApplication. ...
6
by: Dave | last post by:
I want to put the information that the user selects in my combo boxes into a subform that lies on the same form as the combo boxes. Thanks for your help already, Dave
1
by: Dave | last post by:
Hello all, First I'd like to apologize...This post was meant to be put in my previous post, but I tried many times without success to reply within my previous post. Now here goes... I have a...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

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.