Thread View: comp.databases.ms-access
2 messages
2 total messages
Started by Mojtaba Danai
Tue, 01 Jul 2003 17:08
Defining Combo Box values...
Author: Mojtaba Danai
Date: Tue, 01 Jul 2003 17:08
Date: Tue, 01 Jul 2003 17:08
29 lines
2301 bytes
2301 bytes
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
Re: Defining Combo Box values...
Author: 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
>
>
>
>
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads