Field property 'Required' is YES in table... (1 Viewer)

Carl_R

Registered User.
Local time
Today, 12:52
Joined
Aug 16, 2002
Messages
82
I have a text box called 'ClosedDate'
If the CheckBox 'Closed' is checked on the form, ClosedDate appears.

If Me.Closed = 0 Then
Me.ClosedDate.Visible = False
Else
Me.ClosedDate.Visible = True
End If

This works great except input is required in ClosedDate so even if it is not visible, input is still required :( (the field property 'Required' is set to YES in the table).

Is it possible to code that if ClosedDate is not visible, input is not required for ClosedDate?
 

Krysti

Registered User.
Local time
Today, 05:52
Joined
Sep 20, 2002
Messages
40
Why not just change the Required Property to 'No'?

You could also automatically put in the current date when the user checks 'Closed'. This would eliminate the need to make sure the user enters in a date:

If Me.Closed = 0 Then
Me.ClosedDate.Visible = False
Me.ClosedDate = Null
Else
Me.ClosedDate.Visible = True
Me.ClosedDate = Date
End If

Just a suggestion...

Krysti:)
 

Carl_R

Registered User.
Local time
Today, 12:52
Joined
Aug 16, 2002
Messages
82
Thanks for the reply.

ClosedDate is not visible on the form so, as the user does not see it, no input is necessary.

When ClosedDate is visible, input is required. I could set the field value to 'no' but that would defeat the purpose.

The idea is, input would only be required if ClosedDate is visible.

Can't put in the date automatically when it is closed becuase it is a Change Management database and someone may not close a change on the due date. If the change is closed later, the Now()date would not reflect the date the change should have actually been closed.
 
R

Rich

Guest
Use the Before Update event of the Form
If Me.MyCheckBox=True And Not IsDate(Me.MyDateField) Then
Cancel=True
MsgBox
Etc.
 

Users who are viewing this thread

Top Bottom