Connecting Tech Pros Worldwide Help | Site Map
 
 
LinkBack Thread Tools Search this Thread
  #1  
Old February 21st, 2006, 06:35 PM
tlyczko
Guest
 
Posts: n/a
Default 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




  #2  
Old February 21st, 2006, 07:35 PM
Douglas J Steele
Guest
 
Posts: n/a
Default Re: limit two combo boxes with unrelated data??

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" <tlyczko@gmail.com> wrote in message
news:1140545958.036634.321050@g14g2000cwa.googlegr oups.com...[color=blue]
> 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
>[/color]


  #3  
Old February 21st, 2006, 07:55 PM
tlyczko
Guest
 
Posts: n/a
Default Re: limit two combo boxes with unrelated data??

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

  #4  
Old February 22nd, 2006, 01:25 AM
Bob Quintal
Guest
 
Posts: n/a
Default Re: limit two combo boxes with unrelated data??

"tlyczko" <tlyczko@gmail.com> wrote in
news:1140551040.031849.282260@g43g2000cwa.googlegr oups.com:
[color=blue]
> 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[/color]

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
[color=blue]
>Is there any way with this information I can limit the list of
>Combo 2 based on Combo 1??[/color]

Yes, use a third table, programsAudits which contains only the
primary keys of your other two tables.
[color=blue]
>Is it better to ask the end user for the program first, then
>limit the audit descriptions??[/color]

If you use the third table, this question becomes irrelevant as
it is equally easy to do either one first.
[color=blue]
> Should I write code in Combo 2 AfterUpdate event to examine ?
> the program to audit description correlation??[/color]

No, you just need to replace the rowsource in one combobox with
a query that uses your table and the third table.
[color=blue]
> Should I add fields to the lookup tables to facilitate the
> combo box filtering??[/color]

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.
  #5  
Old February 24th, 2006, 07:35 PM
tlyczko
Guest
 
Posts: n/a
Default Re: limit two combo boxes with unrelated data??

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

 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 205,414 network members.