PC Review


Reply
Thread Tools Rate Thread

Cascading Combo Boxes (Multiple boxes)

 
 
Adam
Guest
Posts: n/a
 
      2nd Jul 2008
Im new to Access, but heres what's going on:

I have a Spreadsheet with about 13 columns, each column a different
specification for offshore drilling rigs. So i have 13 different combo boxes.

I have set up a form with 13 combo boxes, each pertaining to a column in my
table. The first three combo boxes are Rig Name, Owner, and World Region. I
have it working thus far to where i can use the drop down menu of combo box
(CB) 1 and choose a Rig Name out of the drop down. I can then proceed to CB 2
and it takes CB 1 info and narrows down the list to the Owner of the Rig in
CB 1. I can proceed through all 13 CB as longas i go in order and it will
work fine.

What i need to do is have this set up to where i can go in a random order
through the 13 combo boxes. I have been doing all of this without using
visual basic, and would prefer to not have to learn that program, but i have
a feeling it would be easiest in the long run.

Thanks for the help.

 
Reply With Quote
 
 
 
 
Mark A. Sam
Guest
Posts: n/a
 
      2nd Jul 2008
Adam,

You should be able to select from the combo boxes in any order. What is the
problem when you go out of order?

God Bless,

Mark A. Sam

"Adam" <(E-Mail Removed)> wrote in message
news:C3D3DCCA-29C4-47B6-9DFC-(E-Mail Removed)...
> Im new to Access, but heres what's going on:
>
> I have a Spreadsheet with about 13 columns, each column a different
> specification for offshore drilling rigs. So i have 13 different combo
> boxes.
>
> I have set up a form with 13 combo boxes, each pertaining to a column in
> my
> table. The first three combo boxes are Rig Name, Owner, and World Region.
> I
> have it working thus far to where i can use the drop down menu of combo
> box
> (CB) 1 and choose a Rig Name out of the drop down. I can then proceed to
> CB 2
> and it takes CB 1 info and narrows down the list to the Owner of the Rig
> in
> CB 1. I can proceed through all 13 CB as longas i go in order and it will
> work fine.
>
> What i need to do is have this set up to where i can go in a random order
> through the 13 combo boxes. I have been doing all of this without using
> visual basic, and would prefer to not have to learn that program, but i
> have
> a feeling it would be easiest in the long run.
>
> Thanks for the help.
>



 
Reply With Quote
 
Adam
Guest
Posts: n/a
 
      2nd Jul 2008
Mark,
When i go out of order, the combo boxes contain nothing; the drop down menus
are blank. I've created the form by doing a query i believe in every combo
box (in the "Row Sourse" field of the properties box).



"Mark A. Sam" wrote:

> Adam,
>
> You should be able to select from the combo boxes in any order. What is the
> problem when you go out of order?
>
> God Bless,
>
> Mark A. Sam
>
> "Adam" <(E-Mail Removed)> wrote in message
> news:C3D3DCCA-29C4-47B6-9DFC-(E-Mail Removed)...
> > Im new to Access, but heres what's going on:
> >
> > I have a Spreadsheet with about 13 columns, each column a different
> > specification for offshore drilling rigs. So i have 13 different combo
> > boxes.
> >
> > I have set up a form with 13 combo boxes, each pertaining to a column in
> > my
> > table. The first three combo boxes are Rig Name, Owner, and World Region.
> > I
> > have it working thus far to where i can use the drop down menu of combo
> > box
> > (CB) 1 and choose a Rig Name out of the drop down. I can then proceed to
> > CB 2
> > and it takes CB 1 info and narrows down the list to the Owner of the Rig
> > in
> > CB 1. I can proceed through all 13 CB as longas i go in order and it will
> > work fine.
> >
> > What i need to do is have this set up to where i can go in a random order
> > through the 13 combo boxes. I have been doing all of this without using
> > visual basic, and would prefer to not have to learn that program, but i
> > have
> > a feeling it would be easiest in the long run.
> >
> > Thanks for the help.
> >

>
>
>

 
Reply With Quote
 
Mark A. Sam
Guest
Posts: n/a
 
      2nd Jul 2008
Do you have anything in the criteria of the queries?

"Adam" <(E-Mail Removed)> wrote in message
news:AED4CC83-FA2A-477A-96B4-(E-Mail Removed)...
> Mark,
> When i go out of order, the combo boxes contain nothing; the drop down
> menus
> are blank. I've created the form by doing a query i believe in every combo
> box (in the "Row Sourse" field of the properties box).
>
>
>
> "Mark A. Sam" wrote:
>
>> Adam,
>>
>> You should be able to select from the combo boxes in any order. What is
>> the
>> problem when you go out of order?
>>
>> God Bless,
>>
>> Mark A. Sam
>>
>> "Adam" <(E-Mail Removed)> wrote in message
>> news:C3D3DCCA-29C4-47B6-9DFC-(E-Mail Removed)...
>> > Im new to Access, but heres what's going on:
>> >
>> > I have a Spreadsheet with about 13 columns, each column a different
>> > specification for offshore drilling rigs. So i have 13 different combo
>> > boxes.
>> >
>> > I have set up a form with 13 combo boxes, each pertaining to a column
>> > in
>> > my
>> > table. The first three combo boxes are Rig Name, Owner, and World
>> > Region.
>> > I
>> > have it working thus far to where i can use the drop down menu of combo
>> > box
>> > (CB) 1 and choose a Rig Name out of the drop down. I can then proceed
>> > to
>> > CB 2
>> > and it takes CB 1 info and narrows down the list to the Owner of the
>> > Rig
>> > in
>> > CB 1. I can proceed through all 13 CB as longas i go in order and it
>> > will
>> > work fine.
>> >
>> > What i need to do is have this set up to where i can go in a random
>> > order
>> > through the 13 combo boxes. I have been doing all of this without using
>> > visual basic, and would prefer to not have to learn that program, but i
>> > have
>> > a feeling it would be easiest in the long run.
>> >
>> > Thanks for the help.
>> >

>>
>>
>>



 
Reply With Quote
 
Adam
Guest
Posts: n/a
 
      2nd Jul 2008
Yes, for the criteria of the combo box being used, it is linked to the column
in the table ( [retry MODU List]![OWNER] ). For the criteria of the combo box
which preceeds it, i have the value in the form ( [Forms]![works straight
thru5]![Rig Name] ).

In my thinking, i would have thought to create a query in each combo box
that has a criteria for all 13 fields. And have them all linked to the form
value, but this does not work when the form value is empty. If i can be more
clear, please tell me, i know this is or can be confusing to write/read about.


"Mark A. Sam" wrote:

> Do you have anything in the criteria of the queries?
>
> "Adam" <(E-Mail Removed)> wrote in message
> news:AED4CC83-FA2A-477A-96B4-(E-Mail Removed)...
> > Mark,
> > When i go out of order, the combo boxes contain nothing; the drop down
> > menus
> > are blank. I've created the form by doing a query i believe in every combo
> > box (in the "Row Sourse" field of the properties box).
> >
> >
> >
> > "Mark A. Sam" wrote:
> >
> >> Adam,
> >>
> >> You should be able to select from the combo boxes in any order. What is
> >> the
> >> problem when you go out of order?
> >>
> >> God Bless,
> >>
> >> Mark A. Sam
> >>
> >> "Adam" <(E-Mail Removed)> wrote in message
> >> news:C3D3DCCA-29C4-47B6-9DFC-(E-Mail Removed)...
> >> > Im new to Access, but heres what's going on:
> >> >
> >> > I have a Spreadsheet with about 13 columns, each column a different
> >> > specification for offshore drilling rigs. So i have 13 different combo
> >> > boxes.
> >> >
> >> > I have set up a form with 13 combo boxes, each pertaining to a column
> >> > in
> >> > my
> >> > table. The first three combo boxes are Rig Name, Owner, and World
> >> > Region.
> >> > I
> >> > have it working thus far to where i can use the drop down menu of combo
> >> > box
> >> > (CB) 1 and choose a Rig Name out of the drop down. I can then proceed
> >> > to
> >> > CB 2
> >> > and it takes CB 1 info and narrows down the list to the Owner of the
> >> > Rig
> >> > in
> >> > CB 1. I can proceed through all 13 CB as longas i go in order and it
> >> > will
> >> > work fine.
> >> >
> >> > What i need to do is have this set up to where i can go in a random
> >> > order
> >> > through the 13 combo boxes. I have been doing all of this without using
> >> > visual basic, and would prefer to not have to learn that program, but i
> >> > have
> >> > a feeling it would be easiest in the long run.
> >> >
> >> > Thanks for the help.
> >> >
> >>
> >>
> >>

>
>
>

 
Reply With Quote
 
Mark A. Sam
Guest
Posts: n/a
 
      2nd Jul 2008
Disregard my last question. I reread your post and see that you are
narrowing each combo list down.

I have never been able to figure out an expression that will allow all
values to be shown if there is nothing in the criteria field. I'm not sure
why it isn't allowed. The best way I could see to approach this is the
allow all the whole list to be displayed and reset the the rowsource of the
following combo whenever you select from any combo. It isn't difficult to
do, but difficult to explain to someone who doesn't program.




"Mark A. Sam" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> Do you have anything in the criteria of the queries?



 
Reply With Quote
 
Mark A. Sam
Guest
Posts: n/a
 
      2nd Jul 2008
I'll try to give you an example of how to do this:

Let say there are two combo's, [Cbo1] and [Cbo2] in [Table1]. The rowsource
on each should be set without criteria.

If you select a value for [Cbo1] you will need to reset the rowsource for
[Cbo2] in the AfterUpdate event. It would look something like this:

Private Sub cbo1_AfterUpdate()

If IsNull(Me.ActiveControl) Then
[Cbo2].RowSource = "SELECT Table1.Field2, Table1.Field1 " & _
"From Table1 " & _
"WHERE Table1.Field1= '" & [Forms]![Form1]![cbo1] & "';"
Else
[Cbo2].RowSource = "SELECT Table1.Field2, Table1.Field1 FROM Table1;"
End If

End Sub


Notice the Where Clause.

"WHERE Table1.Field1= '" & [Forms]![Form1]![cbo1] * "';"
It may be difficult to see, but there are single quotes on the inside of the
double quotes

Field1''" and & "'

This is becuase [Cbo1] is a text field and a text value needs to be
surrounded by quotes. If [Cbo1] was a number field the expression woul
like like this:

"WHERE Table1.Field1= " & [Forms]![Form1]![cbo1]

If it was a Date feld it would look like this:

"WHERE Table1.Field1= #" & [Forms]![Form1]![cbo1] & "#;"

So surround a text value with single quotes and a Date value with # signs.


Hope that helps you and God Bless,

Mark A. Sam


 
Reply With Quote
 
Adam
Guest
Posts: n/a
 
      3rd Jul 2008
Not too sure if i am doing this correctly, but thats why i'm here.

Ive knocked down my 13 combo boxes i need to have down to 4, just to
simplify this until i figure it out, but my combo boxes are:
[Rig Name]
[Owner]
[Rig Heading]
[Mooring Type]

My table is named MODU

and here is what i put into the after update box from what you had posted
(with added nonsense, im sure, since im not into coding)

Private Sub Rig_Name_AfterUpdate()
If IsNull(Me.ActiveControl) Then
[OWNER].RowSource = "SELECT MODU.MOORING_TYPE, MODU.RIG_HEADING,
MODU.OWNER, MODU.RIG_NAME " & _
[RIG HEADING].RowSource = "SELECT MODU.MOORING_TYPE, MODU.RIG_HEADING,
MODU.OWNER, MODU.RIG_NAME " & _
[MOORING TYPE].RowSource = "SELECT MODU.MOORING_TYPE, MODU.RIG_HEADING,
MODU.OWNER, MODU.RIG_NAME " & _
"From MODU " & _
"WHERE MODU.RIG_NAME= '" & [Forms]![MODULIST]![RIG NAME] & "';"
Else
[OWNER].RowSource = "SELECT MODU.MOORING_TYPE, MODU.RIG_HEADING,
MODU.OWNER, MODU.RIG_NAME FROM MODU;"
[RIG HEADING].RowSource = "SELECT MODU.MOORING_TYPE, MODU.RIG_HEADING,
MODU.OWNER, MODU.RIG_NAME FROM MODU;"
[MOORING TYPE].RowSource = "SELECT MODU.MOORING_TYPE, MODU.RIG_HEADING,
MODU.OWNER, MODU.RIG_NAME FROM MODU;"

End If
End Sub




"Mark A. Sam" wrote:

> Disregard my last question. I reread your post and see that you are
> narrowing each combo list down.
>
> I have never been able to figure out an expression that will allow all
> values to be shown if there is nothing in the criteria field. I'm not sure
> why it isn't allowed. The best way I could see to approach this is the
> allow all the whole list to be displayed and reset the the rowsource of the
> following combo whenever you select from any combo. It isn't difficult to
> do, but difficult to explain to someone who doesn't program.
>
>
>
>
> "Mark A. Sam" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
> > Do you have anything in the criteria of the queries?

>
>
>

 
Reply With Quote
 
Mark A. Sam
Guest
Posts: n/a
 
      3rd Jul 2008
No that's wrong. You are trying to assign the rowsource for all of the
combo boxes. It is like this, where you are only setting the Rowsource from
[Owner] if [Rig] gets a value.

Private Sub Rig_Name_AfterUpdate()
If IsNull(Me.ActiveControl) Then
[OWNER].RowSource = "SELECT MODU.MOORING_TYPE, MODU.RIG_HEADING,
MODU.OWNER, MODU.RIG_NAME " & _
"From MODU " & _
"WHERE MODU.RIG_NAME= '" & [Forms]![MODULIST]![RIG NAME] & "';"
Else
[OWNER].RowSource = "SELECT MODU.MOORING_TYPE, MODU.RIG_HEADING,
MODU.OWNER, MODU.RIG_NAME FROM MODU;"
End If
End Sub


If [Owner] gets a value, then set the Rowsource for [Rig Heading], etc.


"Adam" <(E-Mail Removed)> wrote in message
news:8637D34D-5173-4B39-8682-(E-Mail Removed)...
> Not too sure if i am doing this correctly, but thats why i'm here.
>
> Ive knocked down my 13 combo boxes i need to have down to 4, just to
> simplify this until i figure it out, but my combo boxes are:
> [Rig Name]
> [Owner]
> [Rig Heading]
> [Mooring Type]
>
> My table is named MODU
>
> and here is what i put into the after update box from what you had posted
> (with added nonsense, im sure, since im not into coding)
>
> Private Sub Rig_Name_AfterUpdate()
> If IsNull(Me.ActiveControl) Then
> [OWNER].RowSource = "SELECT MODU.MOORING_TYPE, MODU.RIG_HEADING,
> MODU.OWNER, MODU.RIG_NAME " & _
> [RIG HEADING].RowSource = "SELECT MODU.MOORING_TYPE, MODU.RIG_HEADING,
> MODU.OWNER, MODU.RIG_NAME " & _
> [MOORING TYPE].RowSource = "SELECT MODU.MOORING_TYPE, MODU.RIG_HEADING,
> MODU.OWNER, MODU.RIG_NAME " & _
> "From MODU " & _
> "WHERE MODU.RIG_NAME= '" & [Forms]![MODULIST]![RIG NAME] & "';"
> Else
> [OWNER].RowSource = "SELECT MODU.MOORING_TYPE, MODU.RIG_HEADING,
> MODU.OWNER, MODU.RIG_NAME FROM MODU;"
> [RIG HEADING].RowSource = "SELECT MODU.MOORING_TYPE, MODU.RIG_HEADING,
> MODU.OWNER, MODU.RIG_NAME FROM MODU;"
> [MOORING TYPE].RowSource = "SELECT MODU.MOORING_TYPE, MODU.RIG_HEADING,
> MODU.OWNER, MODU.RIG_NAME FROM MODU;"
>
> End If
> End Sub
>
>
>
>
> "Mark A. Sam" wrote:
>
>> Disregard my last question. I reread your post and see that you are
>> narrowing each combo list down.
>>
>> I have never been able to figure out an expression that will allow all
>> values to be shown if there is nothing in the criteria field. I'm not
>> sure
>> why it isn't allowed. The best way I could see to approach this is the
>> allow all the whole list to be displayed and reset the the rowsource of
>> the
>> following combo whenever you select from any combo. It isn't difficult
>> to
>> do, but difficult to explain to someone who doesn't program.
>>
>>
>>
>>
>> "Mark A. Sam" <(E-Mail Removed)> wrote in message
>> news:%(E-Mail Removed)...
>> > Do you have anything in the criteria of the queries?

>>
>>
>>



 
Reply With Quote
 
Adam
Guest
Posts: n/a
 
      8th Jul 2008
I think im having a problem understanding the logic behind this, sorry. But
the post you said i did wrong, why is it not necessary to assign the
rowsource under the "If IsNull" part like this:

Private Sub Rig_Name_AfterUpdate()
If IsNull(Me.ActiveControl) Then
[OWNER].RowSource = "SELECT MODU.MOORING_TYPE, MODU.RIG_HEADING,
MODU.OWNER, MODU.RIG_NAME " & _
[RIG HEADING].RowSource = "SELECT MODU.MOORING_TYPE, MODU.RIG_HEADING,
MODU.OWNER, MODU.RIG_NAME " & _
[MOORING TYPE].RowSource = "SELECT MODU.MOORING_TYPE, MODU.RIG_HEADING,
MODU.OWNER, MODU.RIG_NAME " & _


The way i understand this is, it is saying that if the Rig Name box is
empty, then the [owner], [rig heading], and [mooring type] combo boxes get
their values from the table. And since i would like to go in a random order
through my boxes, i would have thought that its necessary to have all
rowsource values assigned there.

Does my logic make sense at all? Or how should the code be read to make
sense to me?

Also, i have not gotten my form to work yet sadly.



"Mark A. Sam" wrote:

> No that's wrong. You are trying to assign the rowsource for all of the
> combo boxes. It is like this, where you are only setting the Rowsource from
> [Owner] if [Rig] gets a value.
>
> Private Sub Rig_Name_AfterUpdate()
> If IsNull(Me.ActiveControl) Then
> [OWNER].RowSource = "SELECT MODU.MOORING_TYPE, MODU.RIG_HEADING,
> MODU.OWNER, MODU.RIG_NAME " & _
> "From MODU " & _
> "WHERE MODU.RIG_NAME= '" & [Forms]![MODULIST]![RIG NAME] & "';"
> Else
> [OWNER].RowSource = "SELECT MODU.MOORING_TYPE, MODU.RIG_HEADING,
> MODU.OWNER, MODU.RIG_NAME FROM MODU;"
> End If
> End Sub
>
>
> If [Owner] gets a value, then set the Rowsource for [Rig Heading], etc.
>
>
> "Adam" <(E-Mail Removed)> wrote in message
> news:8637D34D-5173-4B39-8682-(E-Mail Removed)...
> > Not too sure if i am doing this correctly, but thats why i'm here.
> >
> > Ive knocked down my 13 combo boxes i need to have down to 4, just to
> > simplify this until i figure it out, but my combo boxes are:
> > [Rig Name]
> > [Owner]
> > [Rig Heading]
> > [Mooring Type]
> >
> > My table is named MODU
> >
> > and here is what i put into the after update box from what you had posted
> > (with added nonsense, im sure, since im not into coding)
> >
> > Private Sub Rig_Name_AfterUpdate()
> > If IsNull(Me.ActiveControl) Then
> > [OWNER].RowSource = "SELECT MODU.MOORING_TYPE, MODU.RIG_HEADING,
> > MODU.OWNER, MODU.RIG_NAME " & _
> > [RIG HEADING].RowSource = "SELECT MODU.MOORING_TYPE, MODU.RIG_HEADING,
> > MODU.OWNER, MODU.RIG_NAME " & _
> > [MOORING TYPE].RowSource = "SELECT MODU.MOORING_TYPE, MODU.RIG_HEADING,
> > MODU.OWNER, MODU.RIG_NAME " & _
> > "From MODU " & _
> > "WHERE MODU.RIG_NAME= '" & [Forms]![MODULIST]![RIG NAME] & "';"
> > Else
> > [OWNER].RowSource = "SELECT MODU.MOORING_TYPE, MODU.RIG_HEADING,
> > MODU.OWNER, MODU.RIG_NAME FROM MODU;"
> > [RIG HEADING].RowSource = "SELECT MODU.MOORING_TYPE, MODU.RIG_HEADING,
> > MODU.OWNER, MODU.RIG_NAME FROM MODU;"
> > [MOORING TYPE].RowSource = "SELECT MODU.MOORING_TYPE, MODU.RIG_HEADING,
> > MODU.OWNER, MODU.RIG_NAME FROM MODU;"
> >
> > End If
> > End Sub
> >
> >
> >
> >
> > "Mark A. Sam" wrote:
> >
> >> Disregard my last question. I reread your post and see that you are
> >> narrowing each combo list down.
> >>
> >> I have never been able to figure out an expression that will allow all
> >> values to be shown if there is nothing in the criteria field. I'm not
> >> sure
> >> why it isn't allowed. The best way I could see to approach this is the
> >> allow all the whole list to be displayed and reset the the rowsource of
> >> the
> >> following combo whenever you select from any combo. It isn't difficult
> >> to
> >> do, but difficult to explain to someone who doesn't program.
> >>
> >>
> >>
> >>
> >> "Mark A. Sam" <(E-Mail Removed)> wrote in message
> >> news:%(E-Mail Removed)...
> >> > Do you have anything in the criteria of the queries?
> >>
> >>
> >>

>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiple cascading combo boxes all clone each other TOP Microsoft Access 3 16th Feb 2009 08:47 PM
Cascading Combo Boxes--Problems Populating Boxes jerryb123 Microsoft Access 0 13th Jun 2008 03:11 PM
complex cascading combo boxes multiple criteria. Rpettis31 Microsoft Access Forms 1 22nd Apr 2008 01:10 PM
multiple cascading combo boxes =?Utf-8?B?am9lbWVzaHVnZ2Fo?= Microsoft Access Form Coding 1 18th Jul 2007 07:30 PM
multiple cascading combo boxes* not the usual. Airwolf via AccessMonster.com Microsoft Access Forms 3 11th Apr 2007 05:15 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:25 AM.