I have a public function that converts off-calendar month dates to a single specified date:
The DDDate is input into the Parent form. However when user inputs the various records into the Child form, I need to compare two dates to determine the propper date for the record (DDDate vs. CancDate [also on the parent form]).
Here's the concept of what I need:
I think my syntax is off, but I can't figure out how. Code doesn't recognize DateBucket(me.parent.DDDate). I've tried me.parent.dddate.value, [me.parent.dddate], [me].[parent].[dddate], ect. I've even tried to create a variable:
Then replaced all of the parent DDDate stuff in the prior code with DDDateTemp.
Thanks in advance!
Public Function DateBucket(DDDate As Date) As String
Select Case DDDate
Case Is <= #3/20/2009# And DDDate >= #2/21/2009#
DateBucket = #3/20/2009#
Case Is <= #4/24/2009# And DDDate >= #3/21/2009#
DateBucket = #4/24/2009#
etc...
The DDDate is input into the Parent form. However when user inputs the various records into the Child form, I need to compare two dates to determine the propper date for the record (DDDate vs. CancDate [also on the parent form]).
Here's the concept of what I need:
If Me.parent.CancDate.Value > DateBucket(Me.parent.DDDate) Then
Me.PSRDate = Me.parent.CancDate
ElseIf DateDiff("d", Me.parent.DDDate.Value, DateBucket(DDDate)) <= 5 Then
Me.PSRDate = DateBucket(Me.parent.DDDate)
Else
Me.PSRDate = DateAdd("d", 7, Me.parent.DDDate)
End If
I think my syntax is off, but I can't figure out how. Code doesn't recognize DateBucket(me.parent.DDDate). I've tried me.parent.dddate.value, [me.parent.dddate], [me].[parent].[dddate], ect. I've even tried to create a variable:
Dim DDDateTemp as Date
DDDateTemp = Me.parent.DDDate.Value
Then replaced all of the parent DDDate stuff in the prior code with DDDateTemp.
Thanks in advance!