Hi everyone.
I've been dinking around with this problem for longer than I care to admit. This is the deal....I have a date field on a form that needs to be checked to determine if the user needs to put data in the next field. Not everyone will have a date (CCare_Date) but if they do I want to be able to put in the provider that wrote the order (cc_by), otherwise I want to skip the cc_by field.
That isn't working if the field is left blank.
Here's my code:
Private Sub CCare_Date_click()
If Me.CCare_Date Is Not Null Then
If Me.CCare_Date > #2/28/2012# Then
Me.cc_by.Enabled = True
End If
Else
Me.cc_by.Enabled = False
End If
End Sub
If: I enter or tab past the CCare_Date I end up in the cc_by field -- wrong
I put in a date earlier than 2/28/12 it doesn't stop -- right
(I'll error check the date later)
I put in a date later than 2/28/12 it stops in the cc_by field -- right
I have tried several iterations of this. I'm thinking it has something to do with checking a date field for a null value??....??? I was successful doing this in another field but it wasn't a date field.
Any & all guidance is appreciated,
Thanks all,
Renee
I've been dinking around with this problem for longer than I care to admit. This is the deal....I have a date field on a form that needs to be checked to determine if the user needs to put data in the next field. Not everyone will have a date (CCare_Date) but if they do I want to be able to put in the provider that wrote the order (cc_by), otherwise I want to skip the cc_by field.
That isn't working if the field is left blank.
Here's my code:
Private Sub CCare_Date_click()
If Me.CCare_Date Is Not Null Then
If Me.CCare_Date > #2/28/2012# Then
Me.cc_by.Enabled = True
End If
Else
Me.cc_by.Enabled = False
End If
End Sub
If: I enter or tab past the CCare_Date I end up in the cc_by field -- wrong
I put in a date earlier than 2/28/12 it doesn't stop -- right
(I'll error check the date later)
I put in a date later than 2/28/12 it stops in the cc_by field -- right
I have tried several iterations of this. I'm thinking it has something to do with checking a date field for a null value??....??? I was successful doing this in another field but it wasn't a date field.
Any & all guidance is appreciated,
Thanks all,
Renee