Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default cascading 3 cboboxes

I have these two cboboxes in my app and the 'cascading' works great.
What I need is the coding for ThirdCboBox that would be using both of
the first two cboboxes to limit the choices available to the userin
the third cbobox , but I don't know how to construct the sql statement
to include two 'limit' criterias in one statement.
Please help me with this - I sure appreciate your time and expertise,
as always. You guys have made this project a fun and successful deal
for me.

First CboBox
Private Sub cboCoName_AfterUpdate()
Me!cboLocation.RowSource = "select tblmain.[location] from tblmain
where tblmain.[CoName] ='" & Me!cboCoName & "'"
Me.cboCoName.Requery
End Sub


SecondCboBox
Private Sub cboLocation_AfterUpdate()
Me!cboStreet.RowSource = "select tblmain.[street] from tblmain
where tblmain.[Location] ='" & Me!cboLocation & "'"
Me.cboStreet.Requery
End Sub

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default cascading 3 cboboxes

As I look at this and try to figure it out it occurs to me that I
don't need code for the third cbobox. I think I need to extend the sql
statement in the second cboBox.

I tried this, without success :-(

SecondCboBox
Me!cboStreet.RowSource = "select tblmain.[street] from tblmain
where tblmain.[Location] ='" & Me!cboLocation & "'" And "select
tblmain.[street] from tblmain where tblmain.[CoName] = '"&
Me!cboCoName & "'"

What I am doing is first choose a Company, then the city they are in,
then their street (all from cboboxes). I can get the Company and the
particular city I want from my tables, but when I choose a street, I
get all streets from all companies in the city I chose. I would like
to get only the street(s) that are relevant to the company and city I
chose.

TIA
Joanne



Joanne wrote:

I have these two cboboxes in my app and the 'cascading' works great.
What I need is the coding for ThirdCboBox that would be using both of
the first two cboboxes to limit the choices available to the userin
the third cbobox , but I don't know how to construct the sql statement
to include two 'limit' criterias in one statement.
Please help me with this - I sure appreciate your time and expertise,
as always. You guys have made this project a fun and successful deal
for me.

First CboBox
Private Sub cboCoName_AfterUpdate()
Me!cboLocation.RowSource = "select tblmain.[location] from tblmain
where tblmain.[CoName] ='" & Me!cboCoName & "'"
Me.cboCoName.Requery
End Sub


SecondCboBox
Private Sub cboLocation_AfterUpdate()
Me!cboStreet.RowSource = "select tblmain.[street] from tblmain
where tblmain.[Location] ='" & Me!cboLocation & "'"
Me.cboStreet.Requery
End Sub


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default cascading 3 cboboxes

Sorry please excuse this post. I put it in the wrong group. Meant to
use the access programming group.

Joanne wrote:

As I look at this and try to figure it out it occurs to me that I
don't need code for the third cbobox. I think I need to extend the sql
statement in the second cboBox.

I tried this, without success :-(

SecondCboBox
Me!cboStreet.RowSource = "select tblmain.[street] from tblmain
where tblmain.[Location] ='" & Me!cboLocation & "'" And "select
tblmain.[street] from tblmain where tblmain.[CoName] = '"&
Me!cboCoName & "'"

What I am doing is first choose a Company, then the city they are in,
then their street (all from cboboxes). I can get the Company and the
particular city I want from my tables, but when I choose a street, I
get all streets from all companies in the city I chose. I would like
to get only the street(s) that are relevant to the company and city I
chose.

TIA
Joanne



Joanne wrote:

I have these two cboboxes in my app and the 'cascading' works great.
What I need is the coding for ThirdCboBox that would be using both of
the first two cboboxes to limit the choices available to the userin
the third cbobox , but I don't know how to construct the sql statement
to include two 'limit' criterias in one statement.
Please help me with this - I sure appreciate your time and expertise,
as always. You guys have made this project a fun and successful deal
for me.

First CboBox
Private Sub cboCoName_AfterUpdate()
Me!cboLocation.RowSource = "select tblmain.[location] from tblmain
where tblmain.[CoName] ='" & Me!cboCoName & "'"
Me.cboCoName.Requery
End Sub


SecondCboBox
Private Sub cboLocation_AfterUpdate()
Me!cboStreet.RowSource = "select tblmain.[street] from tblmain
where tblmain.[Location] ='" & Me!cboLocation & "'"
Me.cboStreet.Requery
End Sub



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
cascading menus breanna77 Excel Discussion (Misc queries) 1 August 25th 08 06:55 PM
Cascading Combo Boxes [email protected] Excel Programming 2 February 10th 06 09:17 AM
CASCADING LIST BOX GASHD1889 Excel Discussion (Misc queries) 2 November 2nd 05 01:15 AM
Cascading ComboBoxes Jim Berglund Excel Programming 0 July 28th 04 04:50 PM
how to use combo cascading box Paulo A. Carvalho Excel Programming 0 September 21st 03 03:01 AM


All times are GMT +1. The time now is 08:58 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"