Making fields into required fields

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I need a field to become Required after another is updated. I'm not sure its
possible as 'required' is set in the table properties. But I'm sure someone
knows how to do it.

Thanks
Paul
 
You should be enforcing 'required' fields yourself because its not good to
allow Access to enforce that. You dont want Access's default messages
appearing except as a way of catching errors. Also, you want to take your own
actions when this happens such as displaying a custom message and putting the
cursor where the error occured. Your tables should also be in a separate
database where users cannot manipulate the properties. You dont want to
change the properties in a shared table because your database would then
cease to be multi-user.

-Dorian
 
In addition to what mscertified posted, the way to accomplish this is to use
the After Update event of the form to determine whether data is required
based on the other field's value and take the appropriate action.
 
Hi,

So in the after update I need something like:

if me.field1 = >0 then me.field2 = required

I know thats probably nor correct...can someone help me please. I need a
users to be required to fill in this field when another field is updated.

Paul
 
After thinking about it a bit more, I think a better way would be in the
Before Update of field2:

If Nz(Me.Field1, 0) > 0 Then
If IsNull(Me.Fiels2) Then
MsgBox "Field 2 Is Required"
Cancel = True
End If
End If
 
Back
Top