Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Force users to update a field

Status
Not open for further replies.

Arjay418

Programmer
Oct 18, 2002
86
US
Hi,

Here's the problem:

On Form 1, a user will enter a value into a field (Field: Status; Value=New).

Later, on Form 2, another user will need to update the field (Field: Status; Value=Updated).

How can I force the user to update this field? Is there a way to get Access to look at Field Status on Form 2 and make sure it doesn't say "New"? If it does, can it prompt the user to change Field Status to something else?

Thanks,

RJ
 
Something like:

Code:
If Me.txtStatus = "New" Then
  MsgBox "Please update the status field", vbOkOnly
End If

Put this in the BeforeUpdate event of the form so it will get triggered when somebody tries to save a record.

John
 
Brilliant! I wasn't famliar enough with the form's BeforeUpdate property to know that was the right event. Can I also prevent the user from proceeding to the next field?

Thanks,
RJ
 
Have you making the change without the user doing it? No matter how many "reminders" you give the users, they can still ignore them and not make the changes.

For instance, in the After Update event, include code something like....
Code:
strSQL = "UPDATE [i]yourtable[/i] " & _
   "SET Status = 'Updated' " & _
   "WHERE RecID = " & me.RecID
DoCmd.RunSQL strSQL


Randy
 
The form's beforeupdate event gets triggered immediately before a record gets saved, it sounds like you need to move that to the BeforeUpdate event of a control (same code, but add Cancel=True before the End If line), but it does mean that you need to handle the fact that they could use fields out of order.

John
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top