IF/THEN required=yes

CraigBFG

Registered User.
Local time
Today, 18:05
Joined
Aug 21, 2003
Messages
68
Can I modify this statement to so that

1. If enabled, data is required.
2. If disabled, value is nulled

Why?
1. If paid in advance, a DatePaid is required.
2. If paid in advance=Yes and date is entered, then user for some reason changes back to PiA=No, DatePaid field should be nulled out - basically safeguard so that you can't mark something as paid, then say it isn't...

Option 1 is crucial, no2 is a niceity.


If Me!APSelect.Value = APYes Then
Me!DatePaid.Enabled = True
Else
Me!DatePaid.Enabled = False
End If
 
You can use some code in the form's before update event to make sure there is a date in the DatePaid field should it be required.

To handle enabling/disabling the date text box, try something like:
Code:
Me.DatePaid.Enabled=If Me.APSelect = "APYes"
where I assume that you want to see if the APSelect textbox has text in it that says "APYes". You can put the code into the APSelect control's AfterUpdate event, though I prefer to use checkboxes for these types of "flips".
 
Last edited:

Users who are viewing this thread

Back
Top Bottom