Help With Combobox Trouble - Writes to Table

X

Xavier

Hello,

I've been struggling with an Access 2003 forms problem that I just
can't figure out. I have one single form that lists "Items" and is
bound to the "Items" table. The form allows for new, edit and delete
modes. One of the fields displayed in the form from the Item table is
"Org". When the form enters edit mode, I make visible on the same
form an "Org" combobox and 3 textboxes ("Prog", "Func", "SubFunc") to
handle the "Org" selection. The "Org" combobox's rowsource is a query
that left joins the "Prog", "Func" and "SubFunc" tables to the "Org"
table. The default values of the combobox and textboxes are the
values of the currently selected record in the "Item's" table.

The weird problem I'm having is that if I change the "Org" in the
combobox, the procedure writes to my "Prog", "Func" and "SubFunc"
tables after the comboboxes AfterUpdate event. The old value in these
tables are changed to the new value. For example, I edit an Item
who's "Org" is "1234" and "Prog" is "A". The "Prog" table will be
rewritten as follows:

Before
ProgID Prog
1 A
2 B

After
ProgID Prog
1 B
2 B

This happens to the "Func" and "SubFunc" tables as well. Does anyone
know what could be happening with my form? I've never run into this
before. I know this is confusing to follow so if you need any more
info, please let me know. Thanks for your help!

Xavier
 
J

John W. Vinson

The weird problem I'm having is that if I change the "Org" in the
combobox, the procedure writes to my "Prog", "Func" and "SubFunc"
tables after the comboboxes AfterUpdate event. The old value in these
tables are changed to the new value. For example, I edit an Item
who's "Org" is "1234" and "Prog" is "A". The "Prog" table will be
rewritten as follows:

What's the Control Source (not rowsource) of the combo box? And what are the
control sources of the three textboxes?

John W. Vinson [MVP]
 
G

Guest

Your combo box is a bound control. If you change it, you change the value in
the current record.
If you are using a combo for lookup to navigate to a different record, it
must be an unbound control.
 
X

Xavier

What's the Control Source (not rowsource) of the combo box? And what are the
control sources of the three textboxes?

John W. Vinson [MVP]

You know, after all this stumbling around, the question you asked is
what helped me figure out what's wrong. The combo box is unbound, but
the textboxes were bound to the form (the Item Table) causing the
values to change unexpectedly. I have now created new unbound
textboxes that are populated by the AfterUpdate event of the combo
box. Thanks for your help!

Xavier
 

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