Automatically Changing the value in a table

J

Jason

I have a form that I'm using to revise records in a
table. When the form is saved, I want to "Revised" field
in the table to automatically change from No to Yes.

Is there code I can add to do that behind the scenes and
not actually ask that question on the form since the only
time the form would be used is when information for a
record is being revised. Thanks
 
K

Katrina

I would add the revised field to the form and make it invisible. Then in the
before Update event procedure for the form I would set the value of the
reveised field to true.


HTH
Kat
 
V

Van T. Dinh

Include the Field Revised in the RecordSource of the Form
and use the Form_BeforeUpdate Event to change the value
like:

Me.Revised = True

Note: You many need to check for NewRec in the
BrforeUpdate Event if you don't want to set Revised to
True for new Record.

HTH
Van T. Dinh
MVP (Access)
 
J

Jason O

My field is named Revised. I will make it invisable, but
shouldn't I set the value to true in the after update or
on save button. Is there VBA code I can use to update the
Revised field to true or yes.

thanks
 
K

Katrina

me.revised = true
you can put it in the Before Update event or the Save Button(if you have
one, be sure to put it before the save record action).
AfterUpdate would change AFTER the record has already been saved.

Kat
 

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