Combo Box Code

  • Thread starter Thread starter DaveB
  • Start date Start date
D

DaveB

I have synchroinized (or tried!!) 2 combo boxes on my form.

However, after I select my choice in my first box, nothing
appears in my second box and I can't determine what I have
missed doing.

My first box is called: Department
My second box is called: Division

So if my Department is Medicine, I should have 5 choices
to select from in the second combo box.

I checked out article 97624, but just can't get what I
have missed.

Any help would be appreciated. Thanks.

DaveB
 
Hi Dave,

When posting a follow-up to a question you previously posted, please post
the followup to the same thread - this makes it easier for everyone to see
the original question and what suggestions have already been given.

Also, when asking for help with code or queries, please post the code and/or
query and give any other details that might help someone spot the problem.

Now, about your problem . . . you should have an AfterUpdate event for the
first combo. In this event you should have a statement that requeries the
second combo:

me.Division.requery

Note that in place of 'Division' above, you should have the name of the
combo control. Make sure by clicking on the control then checking the name
property under the Other tab.

If this doesn't help, post back with your code and the rowsource query for
the second combo. Also double check and post the names of the combo controls
and the names of the fields to which they are bound (Look in the
Controlsource prop of each).
 
My AfterUpdate event is: macSynComboBoxes. This is a
Requery Action on the Control Name: Division

My RowSource for my 1st combobox is Department Table (a
table).

My RowSource for my 2nd combobox is qrySyncComboBoxes.
This is a query with 3 fields: Division ID, Division
Name , Department Name. The Criteria for Department Name
is [Forms]![frmSyncComboBoxes]![Departmemt]

My 2 tables are
Department (Department ID and Department Name...fields)
Division (Division ID, Division Name and Department
Name...fields)

I'm not sure what the hangup is. Thanks.

DaveB
-----Original Message-----
Hi Dave,

When posting a follow-up to a question you previously posted, please post
the followup to the same thread - this makes it easier for everyone to see
the original question and what suggestions have already been given.

Also, when asking for help with code or queries, please post the code and/or
query and give any other details that might help someone spot the problem.

Now, about your problem . . . you should have an AfterUpdate event for the
first combo. In this event you should have a statement that requeries the
second combo:

me.Division.requery

Note that in place of 'Division' above, you should have the name of the
combo control. Make sure by clicking on the control then checking the name
property under the Other tab.

If this doesn't help, post back with your code and the rowsource query for
the second combo. Also double check and post the names of the combo controls
and the names of the fields to which they are bound (Look in the
Controlsource prop of each).

--
Sandra Daigle
[Microsoft Access MVP]
For the benefit of others please post all replies to this newsgroup.

I have synchroinized (or tried!!) 2 combo boxes on my form.

However, after I select my choice in my first box, nothing
appears in my second box and I can't determine what I have
missed doing.

My first box is called: Department
My second box is called: Division

So if my Department is Medicine, I should have 5 choices
to select from in the second combo box.

I checked out article 97624, but just can't get what I
have missed.

Any help would be appreciated. Thanks.

DaveB

.
 
Hi Dave,

Is the first combo bound to the Department name field or to an numeric ID
field? Check the BoundColumn property of the combo to be sure. You need to
be sure that the bound field of the first combo is the same field that is in
the Division table.

Other than that (which you may already have correct) I don't see anything
glaring except that in the query for the second combo, you've spelled
Department as 'Departmemt'. I suspect that this was just a typo.

--
Sandra Daigle
[Microsoft Access MVP]
For the benefit of others please post all replies to this newsgroup.


My AfterUpdate event is: macSynComboBoxes. This is a
Requery Action on the Control Name: Division

My RowSource for my 1st combobox is Department Table (a
table).

My RowSource for my 2nd combobox is qrySyncComboBoxes.
This is a query with 3 fields: Division ID, Division
Name , Department Name. The Criteria for Department Name
is [Forms]![frmSyncComboBoxes]![Departmemt]

My 2 tables are
Department (Department ID and Department Name...fields)
Division (Division ID, Division Name and Department
Name...fields)

I'm not sure what the hangup is. Thanks.

DaveB
-----Original Message-----
Hi Dave,

When posting a follow-up to a question you previously posted, please
post the followup to the same thread - this makes it easier for
everyone to see the original question and what suggestions have
already been given.

Also, when asking for help with code or queries, please post the
code and/or query and give any other details that might help someone
spot the problem.

Now, about your problem . . . you should have an AfterUpdate event
for the first combo. In this event you should have a statement that
requeries the second combo:

me.Division.requery

Note that in place of 'Division' above, you should have the name of
the combo control. Make sure by clicking on the control then
checking the name property under the Other tab.

If this doesn't help, post back with your code and the rowsource
query for the second combo. Also double check and post the names of
the combo controls and the names of the fields to which they are
bound (Look in the Controlsource prop of each).

--
Sandra Daigle
[Microsoft Access MVP]
For the benefit of others please post all replies to this newsgroup.

I have synchroinized (or tried!!) 2 combo boxes on my form.

However, after I select my choice in my first box, nothing
appears in my second box and I can't determine what I have
missed doing.

My first box is called: Department
My second box is called: Division

So if my Department is Medicine, I should have 5 choices
to select from in the second combo box.

I checked out article 97624, but just can't get what I
have missed.

Any help would be appreciated. Thanks.

DaveB

.
 
The form now works fine...thanks. Is there a way for the
choices that are selected in each combo boxe, to to back
into my table? Both of these fields are "unbound", but
have the same names as what is in my table. Dave
-----Original Message-----
Hi Dave,

Is the first combo bound to the Department name field or to an numeric ID
field? Check the BoundColumn property of the combo to be sure. You need to
be sure that the bound field of the first combo is the same field that is in
the Division table.

Other than that (which you may already have correct) I don't see anything
glaring except that in the query for the second combo, you've spelled
Department as 'Departmemt'. I suspect that this was just a typo.

--
Sandra Daigle
[Microsoft Access MVP]
For the benefit of others please post all replies to this newsgroup.


My AfterUpdate event is: macSynComboBoxes. This is a
Requery Action on the Control Name: Division

My RowSource for my 1st combobox is Department Table (a
table).

My RowSource for my 2nd combobox is qrySyncComboBoxes.
This is a query with 3 fields: Division ID, Division
Name , Department Name. The Criteria for Department Name
is [Forms]![frmSyncComboBoxes]![Departmemt]

My 2 tables are
Department (Department ID and Department Name...fields)
Division (Division ID, Division Name and Department
Name...fields)

I'm not sure what the hangup is. Thanks.

DaveB
-----Original Message-----
Hi Dave,

When posting a follow-up to a question you previously posted, please
post the followup to the same thread - this makes it easier for
everyone to see the original question and what suggestions have
already been given.

Also, when asking for help with code or queries, please post the
code and/or query and give any other details that might help someone
spot the problem.

Now, about your problem . . . you should have an AfterUpdate event
for the first combo. In this event you should have a statement that
requeries the second combo:

me.Division.requery

Note that in place of 'Division' above, you should have the name of
the combo control. Make sure by clicking on the control then
checking the name property under the Other tab.

If this doesn't help, post back with your code and the rowsource
query for the second combo. Also double check and post the names of
the combo controls and the names of the fields to which they are
bound (Look in the Controlsource prop of each).

--
Sandra Daigle
[Microsoft Access MVP]
For the benefit of others please post all replies to this newsgroup.


DaveB wrote:
I have synchroinized (or tried!!) 2 combo boxes on my form.

However, after I select my choice in my first box, nothing
appears in my second box and I can't determine what I have
missed doing.

My first box is called: Department
My second box is called: Division

So if my Department is Medicine, I should have 5 choices
to select from in the second combo box.

I checked out article 97624, but just can't get what I
have missed.

Any help would be appreciated. Thanks.

DaveB

.

.
 
Small terminology point here - you said "Both of these fields are
"unbound"". Fields can't be unbound since fields belong to tables and
recordsets - I think you meant to say that the controls are unbound. I don't
want to sound pedanic but it is an important distinction.

Anyway, if I understand correctly you want to take the values selected in
the combos and store them in the table associated with your form? Just go to
the ControlSource property for each combo and select the appropriate field
to *bind* the control to the field in the table.

---
Sandra Daigle
[Microsoft Access MVP]
For the benefit of others please post all replies to this newsgroup.

The form now works fine...thanks. Is there a way for the
choices that are selected in each combo boxe, to to back
into my table? Both of these fields are "unbound", but
have the same names as what is in my table. Dave
-----Original Message-----
Hi Dave,

Is the first combo bound to the Department name field or to an
numeric ID field? Check the BoundColumn property of the combo to be
sure. You need to be sure that the bound field of the first combo is
the same field that is in the Division table.

Other than that (which you may already have correct) I don't see
anything glaring except that in the query for the second combo,
you've spelled Department as 'Departmemt'. I suspect that this was
just a typo.

--
Sandra Daigle
[Microsoft Access MVP]
For the benefit of others please post all replies to this newsgroup.


My AfterUpdate event is: macSynComboBoxes. This is a
Requery Action on the Control Name: Division

My RowSource for my 1st combobox is Department Table (a
table).

My RowSource for my 2nd combobox is qrySyncComboBoxes.
This is a query with 3 fields: Division ID, Division
Name , Department Name. The Criteria for Department Name
is [Forms]![frmSyncComboBoxes]![Departmemt]

My 2 tables are
Department (Department ID and Department Name...fields)
Division (Division ID, Division Name and Department
Name...fields)

I'm not sure what the hangup is. Thanks.

DaveB

-----Original Message-----
Hi Dave,

When posting a follow-up to a question you previously posted,
please post the followup to the same thread - this makes it easier
for everyone to see the original question and what suggestions have
already been given.

Also, when asking for help with code or queries, please post the
code and/or query and give any other details that might help
someone spot the problem.

Now, about your problem . . . you should have an AfterUpdate event
for the first combo. In this event you should have a statement that
requeries the second combo:

me.Division.requery

Note that in place of 'Division' above, you should have the name of
the combo control. Make sure by clicking on the control then
checking the name property under the Other tab.

If this doesn't help, post back with your code and the rowsource
query for the second combo. Also double check and post the names of
the combo controls and the names of the fields to which they are
bound (Look in the Controlsource prop of each).

--
Sandra Daigle
[Microsoft Access MVP]
For the benefit of others please post all replies to this
newsgroup.


DaveB wrote:
I have synchroinized (or tried!!) 2 combo boxes on my form.

However, after I select my choice in my first box, nothing
appears in my second box and I can't determine what I have
missed doing.

My first box is called: Department
My second box is called: Division

So if my Department is Medicine, I should have 5 choices
to select from in the second combo box.

I checked out article 97624, but just can't get what I
have missed.

Any help would be appreciated. Thanks.

DaveB

.

.
 
Back
Top