Combo Box

M

mromyn

Hi -
I'm sure this will be an easy question for most of you. I have a two combo
boxes on a form; the second box list of values is dependant on the entry of
the first. If you enter one record it works great -- more then one record and
all of the values change in the second combo box (for all records in the data
sheet).

What am I missing?

Thanks!
Mel
 
T

Tom Wickerath

Hi mromyn,

Not sure, but I think you may be working with a Continuous form?

Synchronized combo boxes on Continuous form

Tip #16: Data in a combo box control on a continuous form/datasheet
disappears
http://www.fmsinc.com/free/tips.html#tip16foraccess

http://www.rogersaccesslibrary.com/download3.asp?SampleName=CascadingComboInSubform.mdb

Contributed by Sandra Daigle (3/10/2006 in microsoft.public.access)
http://groups.google.com/group/micr...frm/thread/e033253ffea2b09f/718a00e1deccf74f?

“…the problem you are seeing is due to the fact that there is really only
one combo control - it is just displayed multiple times. So whatever you have
for current rowsource will apply to all rows. This makes it difficult to use
synchronized combos on continuous forms. However, there is a fairly easy
workaround. To create the effect of a synchronized combo in a continuous form
create another textbox control, include the display column of the combo in
the Recordsource query of the form (join the foreign table and drag in the
column). Position and size the new textbox so that you can place it directly
over the combo box allowing only the down-arrow portion of the combo to show.

Create a GotFocus event for the textbox that only does a SetFocus to the
combo.

This will create the effect that you are wanting - the correct display value
will always show even though the value itself might not be fit the criteria
that is in effect based on the current record.

Here's a KB Article that explains the problem
(ACC2000:) Combo Box in Continuous Form Shows Incorrect Data
http://support.microsoft.com/?id=208866

Here's a link to my sample database that offers several different
alternatives for displaying this type of data including the technique
described above:

http://www.accessmvp.com/SDaigle/index.htm


Tom Wickerath
Microsoft Access MVP
http://www.accessmvp.com/TWickerath/
http://www.access.qbuilt.com/html/expert_contributors.html
__________________________________________
 
R

Rick Brandt

Hi -
I'm sure this will be an easy question for most of you. I have a two
combo boxes on a form; the second box list of values is dependant on the
entry of the first. If you enter one record it works great -- more then
one record and all of the values change in the second combo box (for all
records in the data sheet).

What am I missing?

Thanks!
Mel

That's how it works. You have ONE of the second ComboBox on your form.
In datasheet or continuous form view that single control is painted on
the screen numerous times, but all of its properties are identical in
every instance (other than things you can affect with conditional
formatting).

Now, all you should see changing is the choices in the drop-down list.
If you are seeing the selected value change in all rows then that means
that the ComboBox is not bound to a field (in which case this is expected
behavior).
 
M

mromyn

Thanks!





Tom Wickerath said:
Hi mromyn,

Not sure, but I think you may be working with a Continuous form?

Synchronized combo boxes on Continuous form

Tip #16: Data in a combo box control on a continuous form/datasheet
disappears
http://www.fmsinc.com/free/tips.html#tip16foraccess

http://www.rogersaccesslibrary.com/download3.asp?SampleName=CascadingComboInSubform.mdb

Contributed by Sandra Daigle (3/10/2006 in microsoft.public.access):
http://groups.google.com/group/micr...frm/thread/e033253ffea2b09f/718a00e1deccf74f?

“…the problem you are seeing is due to the fact that there is really only
one combo control - it is just displayed multiple times. So whatever you have
for current rowsource will apply to all rows. This makes it difficult to use
synchronized combos on continuous forms. However, there is a fairly easy
workaround. To create the effect of a synchronized combo in a continuous form
create another textbox control, include the display column of the combo in
the Recordsource query of the form (join the foreign table and drag in the
column). Position and size the new textbox so that you can place it directly
over the combo box allowing only the down-arrow portion of the combo to show.

Create a GotFocus event for the textbox that only does a SetFocus to the
combo.

This will create the effect that you are wanting - the correct display value
will always show even though the value itself might not be fit the criteria
that is in effect based on the current record.

Here's a KB Article that explains the problem
(ACC2000:) Combo Box in Continuous Form Shows Incorrect Data
http://support.microsoft.com/?id=208866

Here's a link to my sample database that offers several different
alternatives for displaying this type of data including the technique
described above:

http://www.accessmvp.com/SDaigle/index.htm


Tom Wickerath
Microsoft Access MVP
http://www.accessmvp.com/TWickerath/
http://www.access.qbuilt.com/html/expert_contributors.html
__________________________________________
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Combo Box - Conditional and saved to a table 2
Clearing a form? 3
Combo Box 3
Combo Box 1
Cascading ComboBox on SubForm 6
Setting a combo box value 8
Combo Box Help 7
Combo not allowing selection 3

Top