By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,222 Members | 1,730 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,222 IT Pros & Developers. It's quick & easy.

Help with Linking Combo boxes in a Subform

P: n/a
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
Share this Question
Share on Google+
5 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.