Update Yes/No field AFTER record is updated/changed

  • Thread starter Thread starter Bibi Arocho via AccessMonster.com
  • Start date Start date
B

Bibi Arocho via AccessMonster.com

I have a form (verification) that will list a number of records that need
to be verified. It has a Yes/No field that tracks whether each record has
been verified. The user manually clicks this yes/no button initially.
However, if the user needs to go back to the record to make changes, I want
the yes/no button to AUTOMATICALLY set to false, so that we can review it
again without depending on the user to remember to change the status of the
record.

I'm still learning VBA code and have looked at the After Update event, but
I don't understand the concept enough to write an effective code.

In general terms; this is what I think the code should do:

When the record is updated
Set the Yes/No field to No

Can someone tell me how I would go about starting this?
 
Bibi,
The Form itself has an AfterUpdate Property, so you would use that event
to "uncheck" your Verified status.
In the AfterUpdate Property for the form, select [Event Procedure] from
the drop down list.
While the cursor is in the AfterUpdate property, click the 3 dots to the
right (...).
Now your in the module for the form, and you'll see...

Private Sub Form_AfterUpdate

End Sub

Now just place the code you want to run in between these 2 lines... like
so...
Private Sub Form_AfterUpdate
YourVerifyField = False
End Sub

Use the name of your Verify field on the form instead of my
"YourVerifyField" example.

If the Verify field is True, and you change any data on that record, it will
change to False.
hth
Al Camp
 
Bibi said:
I have a form (verification) that will list a number of records that need
to be verified. It has a Yes/No field that tracks whether each record has
been verified. The user manually clicks this yes/no button initially.
However, if the user needs to go back to the record to make changes, I want
the yes/no button to AUTOMATICALLY set to false, so that we can review it
again without depending on the user to remember to change the status of the
record.

I'm still learning VBA code and have looked at the After Update event, but
I don't understand the concept enough to write an effective code.

In general terms; this is what I think the code should do:

When the record is updated
Set the Yes/No field to No


First thought is to use the form's BeforeUpdate event
procedure to set the field to False:
Me.optVerified = False
where optVerified is the name of the option button.

But, that may interfere with a reviewer making any
corrections. If it does, please provide more details about
the date entry/editing/reviewing process.
 
Wouldn't AFTER update be too late? I'd think you'd do this in the BEFORE
update.

--
Rick B



Al Camp said:
Bibi,
The Form itself has an AfterUpdate Property, so you would use that event
to "uncheck" your Verified status.
In the AfterUpdate Property for the form, select [Event Procedure] from
the drop down list.
While the cursor is in the AfterUpdate property, click the 3 dots to the
right (...).
Now your in the module for the form, and you'll see...

Private Sub Form_AfterUpdate

End Sub

Now just place the code you want to run in between these 2 lines... like
so...
Private Sub Form_AfterUpdate
YourVerifyField = False
End Sub

Use the name of your Verify field on the form instead of my
"YourVerifyField" example.

If the Verify field is True, and you change any data on that record, it will
change to False.
hth
Al Camp

Bibi Arocho via AccessMonster.com said:
I have a form (verification) that will list a number of records that need
to be verified. It has a Yes/No field that tracks whether each record has
been verified. The user manually clicks this yes/no button initially.
However, if the user needs to go back to the record to make changes, I
want
the yes/no button to AUTOMATICALLY set to false, so that we can review it
again without depending on the user to remember to change the status of
the
record.

I'm still learning VBA code and have looked at the After Update event, but
I don't understand the concept enough to write an effective code.

In general terms; this is what I think the code should do:

When the record is updated
Set the Yes/No field to No

Can someone tell me how I would go about starting this?
 
Back
Top