Combo box fills in text box? And "Dirty"????

G

Guest

I have two tables, one called Catalog, and the other called Inventory.

Inventory consist of the following fields: ProductID, ProductName, Qty
Inventoried, Qty Received.

Catalog contains numerous fields, including ProductID and ProductName,
amonst about 20 others.

I have made a form, using the wizard, based on Inventory. I want to have it
so that my ProductID field will, when entered, automatically fill out the
ProductName field so that I do not have to keep typing product names in--some
are quite long.

I first made a combo box using the wizard that looked up its own values from
the Catalog table (the ProductID field) and that works great. I then did an
AfterUpdate conflagimation that made it *correctly* pull up the ProductName
and put it in the text box, depending on my combo box's selection of
ProductID.

Here's the problem:
Even though it shows the ProductName on my form, when the record is saved it
shows nothing in the table. It's not saving the name as text into it.

Does my ProductName field need to be bound or unbound? What am I doing wrong?

And, as a second question, what is "OnDirty?" Dirty? What's that mean?
 
G

George Nicholson

If you want ProductName saved in the table then it's control should be
bound.

The follow up question to this is do you really want it to be saved? Why?
Once you have a ProductID isn't storing the name in a 2nd table redundant
(and therefore a violation of normalization rules)? I can understand wanting
it to show on the form during data entry but saving it is a separate issue.
Queries can always pull the corresponding value from Catalog when necessary
and you don't have to worry about updating names in Inventory when they
change in Catalog.

Generally, a form's Dirty property = True once a change has been made to the
current record (i.e., an Update event will be required before we can move
off this record). Dirty = False once that record has been saved/updated (or
if it was never changed to begin with).

HTH,
 

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