Dave T said:
Dirk,
The date fields I calculate show the dates of the week that the
records I am viewing came from. They never change no matter how many
records I view. They are basically "dymanic" labels for the records I
am viewing. Could you expand on the form "load event" procedure?
There are two ways to approach this. One would be to examine (in the
form's Open or Load event) whatever it is that tells the form what set
of records to display -- the form's Filter property, or an OpenArgs
value, or maybe even the WHERE clause of the form's recordsource -- and
then set the value of your unbound text box accordingly.
The other, which I was referring to, would be to use data from the
form's first record to calculate the value. I'm not sure whether you
can refer to values of the form's controls until the Current event has
fired, but you can refer to the first record in the form's
RecordsetClone in the form's Load event. So you could have code along
these lines:
'----- start of example code -----
Private Sub Form_Load()
With Me.RecordsetClone
If .RecordCount > 0 Then
Me!YourDateTextbox = YourFunction(!SomeField)
End If
End With
End Sub
'----- end of example code -----