Changing a Value in a Table from a SubForm

  • Thread starter Thread starter Bob Paup
  • Start date Start date
B

Bob Paup

I am trying to change a value in a table related to the main table using a
combo box in a subform. I get the value to display but I can't make it
change. How do I go about it.
 
I am trying to change a value in a table related to the main table using a
combo box in a subform. I get the value to display but I can't make it
change. How do I go about it.

We can't see your database, Bob. What's the table? What's the recordsource for
the form? for the subform? What's the rowsource for the query? What do you
want changed?
 
John and B Hicks
The table I'm trying to change is "Status". The field in that table is
"Status". The recordsource for the form is a table called "Input". The
recordsource for the subform is "Status". Status table has two fields: Name
and Status. In the subform I have hidden "Name" so that only "status" shows.
The rowsource for the query is SELECT Status.Name, Status.Status FROM Status.

When I select a name on the main form the Status for that name shows in the
subform. I want to have the value that I change the Status to, if I change
it, to change the value in the Status Table. If I don't change the Status, I
want it to remain the same.
 
John and B Hicks
The table I'm trying to change is "Status". The field in that table is
"Status". The recordsource for the form is a table called "Input". The
recordsource for the subform is "Status". Status table has two fields: Name
and Status. In the subform I have hidden "Name" so that only "status" shows.
The rowsource for the query is SELECT Status.Name, Status.Status FROM Status.

When I select a name on the main form the Status for that name shows in the
subform. I want to have the value that I change the Status to, if I change
it, to change the value in the Status Table. If I don't change the Status, I
want it to remain the same.

It sounds like you may need another table. If each Name (by the way, Name is a
reserved word and a *bad choice* for a fieldname) can have its own status, and
each status can apply to many names, you should have a field Status in the
Input table, and a table Status with *NO* name field but just a Status field,
containing all of the valid Status values.

Maybe I'm misunderstanding but I think your subform is overkill for what you
want to do.
 
The main form is adding records to the table "Input". The subform is
verifying or correcting the table "Status". The first thing that happens
when entering a new record to the table "Input" is the name of the person is
input until enough letters of that persons name are input the name is filled
in from another table "Name". Entry of data continues with a Tab to the next
field. At the same time the Name is selected from the Status table, which
then displays the Status of the person. If the person has no status or it is
wrong the status is changed. After entry of the second data field the form
is advanced to the next record where the process is repeated. This all works
except the Status table is not changed if the value changed. I appoligize for
being so sloppy in my naming of tables and fields. I am thinking I need a
vba statement in the update entry of the subform like On Update ....
 
Back
Top