Combo Box and Output to table...

9

91PCL91

I am hoping to find out if there is a way to have 4 seperate combo boxes only
report the option which was selected to the table rather then 1 field in the
table for each combo box option. I have 4 combo boxes in my form with 5
options in each so this would create 20 additional fields in my table when
all I need is a field for the option the user selects.

I hope that makes sense and I appreciate any assistance in this regard.
 
L

Linq Adams via AccessMonster.com

You only need one field in your table per option combobox, so a total of four.
Cod eyour comboboxes like this:

Private Sub OptionComboBox1_AfterUpdate()
Me.OptionTextBox1 = Me.OptionComboBox1
End Sub


with OptionTextBox1, etc, bound to the field in the underlying table.
 
A

Arvin Meyer MVP

Have you done something like call the underlying field a multi-value field?
If so change that. A combo box should have 2 or more columns. The required 2
columns are the key field and the description field. Generally, the field in
the underlying table is bound to the key field but that column is usually
set at zero (0") width, and the displayed column id the description field.
 
K

KARL DEWEY

Somehow your wording did not explain it to me.

How does the number of options available in a combo box determine the number
of fields in a table?
 
J

Jeff Boyce

"How" depends on "what", and I don't have any ideas what your data/tables
look like...

More info, please...

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
9

91PCL91

My appologies as I am still learning Access and am not quite sure how to
explain. Allow me to try a different explination.

I have a combo box which has one column which contains five options to
select from. When the user selects that option and then saves the record the
table which stores the data cannot differentiate between one record and the
next so it changes that fields data for every record saved. I am trying to
have user unput data and update the table but the table stores the data for
each record individually.

This is the email I recieved from a peer that is leading me along this
track...

"I created a table to store the data. I'm not sure how you're going to store
the categories since you are using a separate option box for each of the
ratings. Otherwise you may have to go back to the drop down combo box so
that there is only one field reference. Currently the way it's set up your
table will have to have Courtesy1, Courtesy2, Courtesy3, etc. So you'll have
20 fields instead of 4."

Hope this helps in some small way.
 
A

Arvin Meyer MVP

Your problem is that the data in the combo is not bound to the field in the
table. If you look at the combo in Design View, you'll see "unbound" in the
combo box and the controlsource will be blank. You need to choose a
controlsource.
 

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

Top