I have two fields on a form. One of the fields has to be entered first in order for the other field to be filled. How can I restrict the user to enter a value in filed #2 before filling the filed #1?
This is very easy, by hide, lock or disable the control for Field2.
The main question is: How to check when the control for Field1 is filled ?
Say that a user must fill the Field1 with a numeric data.
After he type "1" is OK because is a numeric data. But, maybe, the input should be at least "123".
So, using pseudo code, your approach should be:
Code:
Private Sub ControlForField1_Change
If Field1_IsFilledWithRightData then
ControlForField2.Locked = False
Else
ControlForField2.Locked = True
End if
End Sub
in the form beforeupdate event put code something like this (not tested)
Code:
if [ProjectApproval]=true and nz([ProjectApprovalDate])="" then
msgbox "you must enter an approval date"
projectapprovaldate.setfocus
cancel=true
end if
What you actually need depends on how your form is intended to work - are there other fields that must be completed etc. Validation around the date entry (i.e. must be later than today and within 3 months, etc)