C
cbnewman
Why isn't this working?
I have a form which has a text box for an attribute of type DATE. This
attribute, foo, is normally null when the form is loaded. I tried
setting the default value for the text box to "Date()" but it doesn't
show up (i'm thinking it's because I'm actually running a join query
to generate the record for the form so the form never gets the
opportunity to display the default value for foo since it thinks it's
supposed to be null, the result from the query)
So I added some code like this:
Private Sub Form_Open(Cancel As Integer)
If (IsNull(Me.foo)) Then
Me.foo = Date()
End If
End Sub
This generates a run-time error complaining that I am not allowed to
assign a value to Me.foo.
What am I doing wrong?
Thanks,
--b
I have a form which has a text box for an attribute of type DATE. This
attribute, foo, is normally null when the form is loaded. I tried
setting the default value for the text box to "Date()" but it doesn't
show up (i'm thinking it's because I'm actually running a join query
to generate the record for the form so the form never gets the
opportunity to display the default value for foo since it thinks it's
supposed to be null, the result from the query)
So I added some code like this:
Private Sub Form_Open(Cancel As Integer)
If (IsNull(Me.foo)) Then
Me.foo = Date()
End If
End Sub
This generates a run-time error complaining that I am not allowed to
assign a value to Me.foo.
What am I doing wrong?
Thanks,
--b