Set Required property for field based on the entry in other field

G

Guest

I need to set the Required method of a memo field based upon the entry in the
previous field. Normally, the field is not required, but if the entry in the
previous field falls below 0.5 or above 5.0, then an explanation in the memo
field is necessary.

According to the Help, the Required property is enforced at the table level,
but is there any way you can use code to change it based on criteria.

Thanks for your help as this is my first database!
 
K

Keith Leslein

You can enable/disable the memo field on the form based on the criteria
of the field that identifies below 0.5 or > 5.0. Is this value entered
by the user? If so you can use the following in the After Update of
the value entry field:


example_AfterUpdate()

If txtExample < 0.5 or > 5.0 Then
me.memofieldname.Enabled = True
Else
me.memonamefield.enabled = False
End if

You may need to do some slight modifying based on the data types of
these fields, but this should be a starting point .

Thanks!
 
G

Guest

The memo field should be available for use at all times, but must be used if
the criteria in the previous field is not met. Therefore, enabled won't work
for my needs. How can I keep them from leaving the current record without
completing it if the criteria is not met?
 

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