mandatory field in specific scenarios.

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.
 
A

Allen Browne

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
 

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