ComboBox Writing to First Record

E

ellidavd

I have a table called Hoods that stores the locations and descriptions
of graduation hoods. Here are the columns in the table:

Aisle, Sect, Box, Fabric, Degree, Color1, Color2, Color3, and Qty.

We have one form where a user can make selections from a combobox and
then open another form and display the records based on those
selections. On the first form, the user will make selections of Fabric,
Degree, Color1, Color2, and Color3 from a combobox. The next form will
then display Aisle, Sect, Box, and Qty for all the records in the table
that match those criteria. For example, from the combobox a user might
pick Fabric = VIP, Degree = Bachelor, Color1 = Black, Color2 = Gold,
and Color3 = Black. The user can then add or remove from the qty on the
second form. The quantity for that particular box, aisle and section is
then updated. That part seems to work.

Here is the problem. When a user makes a selection from the combobox,
it writes that selection to the field in the first record. For example,
the first record might contain Black for Color1. If a user selects
Green for Color1 it changes that value to Green.

Here are the properties for the combobox:

Control Source = the column name in the table - Fabric, Degree, etc.
Row Source Type = Value List
Row Source = The data for each column.

I also have the word "All" in the Row Source so a user can search on
all Fabrics, Degrees, or Colors. I am using code to handle that. We can
leave that out of the solution until I get the first problem solved
first.

Any suggestions? I think I need to not bind the data, but I still want
the data on the second form to be filtered based on the criteria of the
first form. I also still need it to update the quantity for the record
selected (the part that is working). I would like to do this with the
minimum amount of code that is possible since others might be expanding
on it.

Thanks for any help.
 
R

Rick Brandt

Here is the problem. When a user makes a selection from the combobox,
it writes that selection to the field in the first record. For
example, the first record might contain Black for Color1. If a user
selects Green for Color1 it changes that value to Green.

Here are the properties for the combobox:

Control Source = the column name in the table - Fabric, Degree, etc.
Row Source Type = Value List
Row Source = The data for each column.

A ComboBox is either used for navigating OR is bound to the underlying table.
You can't use the same control to do both.

Remove the ControlSource entry and you should be fine.
 
E

ellidavd

Thank you, Rick. That seems to work. I'm used to working with combo
boxes in VB.net and C# and was apparently misunderstanding how they
work in Access.
 

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