473,387 Members | 3,810 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Help with Linking Combo boxes in a Subform

I have created two combo boxes in a subform....

For example

1. Combo Box State
2. Combo Box City
3. When a state from the Combo Box State is selected, the City combo
box updates to reflect the State chosen by only showing cities in that
selected state.
4. When I open just the subform it works just fine but when I open the
Main form the contains the subform there are issues....
5. I can pick the State just fine but when I go to pick the City - a
box = an "Enter Parameter Value" opens...requesting the value for
[forms]![subform]![cbostate]. The city combo box is now blank.

The row source for the city combo box is a query that contains the
city and the state field - the criteria for the state field [forms]!
[subform]![cbostate].

Not sure why it works, when I do test via the subform but doesn't work
when when I go the main form that includes the subform....

Any ideas would be very appreciated.

Thx!
Jun 27 '08 #1
5 4864
On May 28, 12:04*am, samdev <la...@noblesoftwaresolutions.comwrote:
I have created two combo boxes in a subform....

For example

1. Combo Box State
2. Combo Box City
3. When a state from the Combo Box State is selected, the City combo
box updates to reflect the State chosen by only showing cities in that
selected state.
4. When I open just the subform it works just fine but when I open the
Main form the contains the subform there are issues....
5. I can pick the State just fine but when I go to pick the City - a
box = an "Enter Parameter Value" opens...requesting the value for
[forms]![subform]![cbostate]. The city combo box is now blank.

The row source for the city combo box is a query that contains the
city and the state field - the criteria for the state field [forms]!
[subform]![cbostate].

Not sure why it works, when I do test via the subform but doesn't work
when when I go the main form that includes the subform....

Any ideas would be very appreciated.

Thx!
As usual ther are many ways to skin a cat. A lot depends on how you
have your data set up. Please describe how the State and the City
data are maintained.
Jun 27 '08 #2
When you open just the subform, the subform is a member of the database
forms collection so your [forms]![subform]![cbostate] notation correctly
identifies the subform. When you open the main form, the subform is a member
of the main form's controls collection so your [forms]![subform]![cbostate]
notation is not now correct because you are referencing the forms collection
and not the main form's controls collection. The correct notation is
[forms]![nameofsubformcontrolonmainform].form![cbostate]. To get
"nameofsubformcontrolonmainform" , open the main form in design view, select
the box that holds the subform, open Properties, go to the Other tab and
look at the Name property.

Steve
"samdev" <la***@noblesoftwaresolutions.comwrote in message
news:bd**********************************@j22g2000 hsf.googlegroups.com...
>I have created two combo boxes in a subform....

For example

1. Combo Box State
2. Combo Box City
3. When a state from the Combo Box State is selected, the City combo
box updates to reflect the State chosen by only showing cities in that
selected state.
4. When I open just the subform it works just fine but when I open the
Main form the contains the subform there are issues....
5. I can pick the State just fine but when I go to pick the City - a
box = an "Enter Parameter Value" opens...requesting the value for
[forms]![subform]![cbostate]. The city combo box is now blank.

The row source for the city combo box is a query that contains the
city and the state field - the criteria for the state field [forms]!
[subform]![cbostate].

Not sure why it works, when I do test via the subform but doesn't work
when when I go the main form that includes the subform....

Any ideas would be very appreciated.

Thx!

Jun 27 '08 #3
On May 28, 2:15*pm, "Steve" <no...@email.comwrote:
When you open just the subform, the subform is a member of the database
forms collection so your *[forms]![subform]![cbostate] notation correctly
identifies the subform. When you open the main form, the subform is a member
of the main form's controls collection so your [forms]![subform]![cbostate]
notation is not now correct because you are referencing the forms collection
and not the main form's controls collection. The correct notation is
[forms]![nameofsubformcontrolonmainform].form![cbostate]. To get
"nameofsubformcontrolonmainform" , open the main form in design view, select
the box that holds the subform, open Properties, go to the Other tab and
look at the Name property.

Steve

"samdev" <la...@noblesoftwaresolutions.comwrote in message

news:bd**********************************@j22g2000 hsf.googlegroups.com...
I have created two combo boxes in a subform....
For example
1. Combo Box State
2. Combo Box City
3. When a state from the Combo Box State is selected, the City combo
box updates to reflect the State chosen by only showing cities in that
selected state.
4. When I open just the subform it works just fine but when I open the
Main form the contains the subform there are issues....
5. I can pick the State just fine but when I go to pick the City - a
box = an "Enter Parameter Value" opens...requesting the value for
[forms]![subform]![cbostate]. The city combo box is now blank.
The row source for the city combo box is a query that contains the
city and the state field - the criteria for the state field [forms]!
[subform]![cbostate].
Not sure why it works, when I do test via the subform but doesn't work
when when I go the main form that includes the subform....
Any ideas would be very appreciated.
Thx!- Hide quoted text -

- Show quoted text -
Steve:
Thx - I have tried that it still doesn't work and it should from what
you have explained....I even changed the name of the subform in the
mainform and then went and updated the query and I'm still getting the
same parameter value box. I checked to make sure that I was clicking
on the subform box in the mainform by checking the title of the
property box and it reads Subform/subreport so still not sure what is
wrong.

Any other ideas.

Thx!
Jun 27 '08 #4
I reread my reply to you and I made an error. Sorry!!

[forms]![nameofsubformcontrolonmainform].form![cbostate]

Should Be:

[forms]!{NameOfMainForm]![nameofsubformcontrolonmainform].form![cbostate]

Also, the white box on your main form is a subform control. The name of that
control is what you want for [nameofsubformcontrolonmainform] NOT the name
of your subform. The name of the subform control may or may not be the same
as the name of the subform.

Steve

"samdev" <la***@noblesoftwaresolutions.comwrote in message
news:5a**********************************@s50g2000 hsb.googlegroups.com...
On May 28, 2:15 pm, "Steve" <no...@email.comwrote:
When you open just the subform, the subform is a member of the database
forms collection so your [forms]![subform]![cbostate] notation correctly
identifies the subform. When you open the main form, the subform is a
member
of the main form's controls collection so your
[forms]![subform]![cbostate]
notation is not now correct because you are referencing the forms
collection
and not the main form's controls collection. The correct notation is
[forms]![nameofsubformcontrolonmainform].form![cbostate]. To get
"nameofsubformcontrolonmainform" , open the main form in design view,
select
the box that holds the subform, open Properties, go to the Other tab and
look at the Name property.

Steve

"samdev" <la...@noblesoftwaresolutions.comwrote in message

news:bd**********************************@j22g2000 hsf.googlegroups.com...
I have created two combo boxes in a subform....
For example
1. Combo Box State
2. Combo Box City
3. When a state from the Combo Box State is selected, the City combo
box updates to reflect the State chosen by only showing cities in that
selected state.
4. When I open just the subform it works just fine but when I open the
Main form the contains the subform there are issues....
5. I can pick the State just fine but when I go to pick the City - a
box = an "Enter Parameter Value" opens...requesting the value for
[forms]![subform]![cbostate]. The city combo box is now blank.
The row source for the city combo box is a query that contains the
city and the state field - the criteria for the state field [forms]!
[subform]![cbostate].
Not sure why it works, when I do test via the subform but doesn't work
when when I go the main form that includes the subform....
Any ideas would be very appreciated.
Thx!- Hide quoted text -

- Show quoted text -
Steve:
Thx - I have tried that it still doesn't work and it should from what
you have explained....I even changed the name of the subform in the
mainform and then went and updated the query and I'm still getting the
same parameter value box. I checked to make sure that I was clicking
on the subform box in the mainform by checking the title of the
property box and it reads Subform/subreport so still not sure what is
wrong.

Any other ideas.

Thx!
Jun 27 '08 #5
On May 28, 6:49*pm, "Steve" <no...@email.comwrote:
I reread my reply to you and I made an error. Sorry!!

*[forms]![nameofsubformcontrolonmainform].form![cbostate]

Should Be:

*[forms]!{NameOfMainForm]![nameofsubformcontrolonmainform].form![cbostate]

Also, the white box on your main form is a subform control. The name of that
control is what you want for [nameofsubformcontrolonmainform] NOT the name
of your subform. The name of the subform control may or may not be the same
as the name of the subform.

Steve

"samdev" <la...@noblesoftwaresolutions.comwrote in message

news:5a**********************************@s50g2000 hsb.googlegroups.com...
On May 28, 2:15 pm, "Steve" <no...@email.comwrote:


When you open just the subform, the subform is a member of the database
forms collection so your [forms]![subform]![cbostate] notation correctly
identifies the subform. When you open the main form, the subform is a
member
of the main form's controls collection so your
[forms]![subform]![cbostate]
notation is not now correct because you are referencing the forms
collection
and not the main form's controls collection. The correct notation is
[forms]![nameofsubformcontrolonmainform].form![cbostate]. To get
"nameofsubformcontrolonmainform" , open the main form in design view,
select
the box that holds the subform, open Properties, go to the Other tab and
look at the Name property.
Steve
"samdev" <la...@noblesoftwaresolutions.comwrote in message
news:bd**********************************@j22g2000 hsf.googlegroups.com...
>I have created two combo boxes in a subform....
For example
1. Combo Box State
2. Combo Box City
3. When a state from the Combo Box State is selected, the City combo
box updates to reflect the State chosen by only showing cities in that
selected state.
4. When I open just the subform it works just fine but when I open the
Main form the contains the subform there are issues....
5. I can pick the State just fine but when I go to pick the City - a
box = an "Enter Parameter Value" opens...requesting the value for
[forms]![subform]![cbostate]. The city combo box is now blank.
The row source for the city combo box is a query that contains the
city and the state field - the criteria for the state field [forms]!
[subform]![cbostate].
Not sure why it works, when I do test via the subform but doesn't work
when when I go the main form that includes the subform....
Any ideas would be very appreciated.
Thx!- Hide quoted text -
- Show quoted text -

Steve:
Thx - I have tried that it still doesn't work and it should from what
you have explained....I even changed the name of the subform in the
mainform and then went and updated the query and I'm still getting the
same parameter value box. I checked to make sure that I was clicking
on the subform box in the mainform by checking the title of the
property box and it reads Subform/subreport so still not sure what is
wrong.

Any other ideas.

Thx!- Hide quoted text -

- Show quoted text -
It worked - THANK YOU! THANK YOU!
Jun 27 '08 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Tony Williams | last post by:
I have two tables one lists the names of committees and the other is a list of documents they generate. I have a form based on the documents table which gives details of the document including...
2
by: Megan | last post by:
Can you write conditional VBA code that affects only one or two records on a continuous subform? I have a form with a subform on it. The parent/ child field that links the forms is CaseID. The...
4
by: Mason | last post by:
This is probably an incredibly newbie-ish question. I just haven't had the cause to use many subforms before, so I'm pretty sure I just don't understand it correctly (even after reading up on it)....
0
by: Rob Kennedy | last post by:
I am using a form with 2 linked combo boxes to query results on a sub-form. With my extreme lack of Access programming skills and the wealth of information on this forum I have been able to...
3
by: Mike Jakes | last post by:
I hope that someone can offer a little advice on this one - I've searched the group but can't find an answer. I think that I'm doing something really stupid or missing something trivial, but see...
3
by: panwala_bhavesh | last post by:
I have a form (View All Assets) with two combo boxes (ComboManufacturer & ComboProductType) and a subform with a dataview that displays the results of my query below: SELECT Assets., Assets....
3
by: Phil | last post by:
I've posted this a few times without any luck, hoping for some fresh ideas on this. I'm pretty certain this can be done. I've been using a micrsoft template to create a supplier database called...
5
by: NateDogg | last post by:
This is what I am using to filter my combo box based on what is selected in the previous box. Open the properties for the second combo box. Next to the 'Row Source' property, click on the '...'. ...
3
by: Strasser | last post by:
In a nested subform in datasheet view, an interviewer of homeless people picks a descriptive CATEGORY from 20 descriptive categories. The 20 categories are displayed via a combo box. (Categories...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.