W
WDSnews
I'm having trouble referencing an unbound field on a parent form to set a
date field in the subform. My child table has a date field called "Return
Date". On the subform I named it 'fldReturnDate'. There is an unbound
field on the parent-form named 'fldUseDate'. A third field of interest is a
logical Yes/No field named 'chkReturned' on the subform.
I'm capturing the 'After Update' event on the checkmark of 'chkReturned' to
set 'fldReturnDate', based on data in 'fldUseDate'. Here's what happens.
Upon running the form, I enter a date such as 06/10/2008 in the fldUseDate
field. Then when I check a box in chkReturned on the subform, it basically
enters a zero date in fldReturnDate. (i.e. it enters 12:00:00 PM). I
can't use the 'Now' function, because most times a user-entered date is
needed.
My code:
Private Sub chkReturned_AfterUpdate()
If chkReturned Then
fldReturnDate = fldUseDate
Else
fldReturnDate = ""
End If
End Sub
I suspect I'm lacking a Parent reference. ? Your help is appreciated.
date field in the subform. My child table has a date field called "Return
Date". On the subform I named it 'fldReturnDate'. There is an unbound
field on the parent-form named 'fldUseDate'. A third field of interest is a
logical Yes/No field named 'chkReturned' on the subform.
I'm capturing the 'After Update' event on the checkmark of 'chkReturned' to
set 'fldReturnDate', based on data in 'fldUseDate'. Here's what happens.
Upon running the form, I enter a date such as 06/10/2008 in the fldUseDate
field. Then when I check a box in chkReturned on the subform, it basically
enters a zero date in fldReturnDate. (i.e. it enters 12:00:00 PM). I
can't use the 'Now' function, because most times a user-entered date is
needed.
My code:
Private Sub chkReturned_AfterUpdate()
If chkReturned Then
fldReturnDate = fldUseDate
Else
fldReturnDate = ""
End If
End Sub
I suspect I'm lacking a Parent reference. ? Your help is appreciated.