Article View: comp.databases.ms-access
Article #217Re: Defining Combo Box values...
From: PC Datasheet
Date: Tue, 01 Jul 2003 17:44
Date: Tue, 01 Jul 2003 17:44
79 lines
3634 bytes
3634 bytes
Greetings to Ireland!!
Here's an example to follow ---
TblMake
MakeID
MakeName
TblModel
ModelID
MakeID
ModelName
Base combobox1 on TblMake. Set bound column = 1, Column Count = 2, Column Width
to 0;1.5.
Create a query based on TblModel. Set the criteria for MakeID to:
Forms!NameOfYourForm!ComboBox1
Base combobox2 on the above query. Set bound column = 1, Column Count = 3,
Column Width to 0;0;1.5.
Put this code in the AfterUpdate event of combobox1:
Me!Combobox2.Requery
Put this code in the form's OnCurrent event:
Me!Combobox2.Requery
--
PC Datasheet
A Resource for Access, Excel and Word Applications
resource@pcdatasheet.com
www.pcdatasheet.com
� Design and basic development for new applications
� Additions, Modifications and "Fixes" for existing applications
� Mentoring for do-it-yourselfers who want guidance
� Complete application design and development
� Applications Using Palm Pilot To Collect Data And
Synchronize The Data Back To Access Or Excel
"Mojtaba Danai" <mojtaba.danai@eei.ericsson.se> wrote in message
news:bdsf66$70a$1@newstree.wise.edt.ericsson.se...
> Hi
>
> I am trying to make a From with two Combo Box in it. I wish to have the
> following behaviour in the form;
>
> When I choose a value from the first Combo Box (Combo1), which has its Row
> Source a table, the values presented on the second Combo Box (Combo2) be
> based on Combo1.
> So if I change the value in Combo1, the list in Combo2 has to changed.
>
> These values for these two combo boxes have to be read from two tables,
> which have one-many relation. That is why the values of Combo2 is depend of
> values form Combo1.
>
> Does any body know, how I can do this? In Row Source properties for Combo2
> or Control Source?
> How the SQL query looks like?
>
> for exampel: select col2 from tab1, tab2 where table1.col1=
> Froms!Myform!MyCombo.Column(0)
> But the above SQL does not work!
>
> Hope that some body can help
>
> Thanks in advance
>
> Regards
> Mojtaba Danai
> Ericsson Ireland
>
>
>
>
Technical Details
Message-ID:
<LLjMa.73709$Io.6897786@newsread2.prod.itd.earthlink.net>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!newshub.sdsu.edu!elnk-pas-nf2!newsfeed.earthlink.net!stamper.news.pas.earthlink.net!newsread2.prod.itd.earthlink.net.POSTED!not-for-mailReferences:
<bdsf66$70a$1@newstree.wise.edt.ericsson.se>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: ff0ac,e5f3c0efd41b59a6 X-Google-Attributes: gidff0ac,public X-Google-Thread: 11387c,e5f3c0efd41b59a6 X-Google-Attributes: gid11387c,public X-Google-Thread: 10bb27,e5f3c0efd41b59a6 X-Google-Attributes: gid10bb27,public X-Google-Thread: 1163bd,e5f3c0efd41b59a6 X-Google-Attributes: gid1163bd,public X-Google-ArrivalTime: 2003-07-01 10:44:06 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!newshub.sdsu.edu!elnk-pas-nf2!newsfeed.earthlink.net!stamper.news.pas.earthlink.net!newsread2.prod.itd.earthlink.net.POSTED!not-for-mail From: "PC Datasheet" <resource@pcdatasheet.com> Newsgroups: comp.databases.ms-access,dk.edb.database.ms-access,microsoft.public.access.formsprogramming,microsoft.public.access.queries References: <bdsf66$70a$1@newstree.wise.edt.ericsson.se> Subject: Re: Defining Combo Box values... Lines: 81 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2720.3000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Message-ID: <LLjMa.73709$Io.6897786@newsread2.prod.itd.earthlink.net> Date: Tue, 01 Jul 2003 17:44:11 GMT NNTP-Posting-Host: 64.91.148.133 X-Complaints-To: abuse@earthlink.net X-Trace: newsread2.prod.itd.earthlink.net 1057081451 64.91.148.133 (Tue, 01 Jul 2003 10:44:11 PDT) NNTP-Posting-Date: Tue, 01 Jul 2003 10:44:11 PDT Organization: EarthLink Inc. -- http://www.EarthLink.net