mandatory field in specific scenarios.

  • Thread starter Thread starter NOEL
  • Start date Start date
N

NOEL

I created a database that stores some type of requests. I
have a designated area for modification: if some one make
a modification to an existing request data needs to be
entered in these field.

1) How can the modifications fields switch to mandatory
once a modification is made to specific fields.

2) How can I automate a report to run daily for requests
that have been modified during a specific day.
 
You can do this if the modifications are entered only through a form (not
directly into the table/query screens).

This example shows how to insist the Modification field has an entry if the
user is changing an existing record, and also how to set a field named
ModifiedOn to the date and time the record was last modified. Make sure you
use the BeforeUpdate event of the form (not that of a control):

Private Sub Form_BeforeUpdate(Cancel As Integer)
If Not Me.NewRecord Then
If IsNull(Me.Modification) Then
Cancel = True
MsgBox "You must enter Modification."
Else
Me.ModifiedOn = Now()
End If
End If
End Sub
 
Back
Top