Parameter Value against a IIf statement

gmach5

New member
Local time
Yesterday, 19:47
Joined
Apr 25, 2013
Messages
5
I am using Allen Brown's recurring events database that I found from his page on the internet. I have modified this just a little bit and was wondering about the IIf statement written below. This statement returns a "date" each time the event occurs. I want to have a parameter between [Start Date] and [End Date] so I can pull events for a specified date range. I have tried this "«Expr» [EventDate]" Between [start date] And [end date] but it returns "null" results. I:mad: have tried everything I know how to do, which I can say is not much because I am in the learning stages of Access. I am using access 2010

EventDate: IIf([tblEventException].[EventID] Is Null,IIf(([qryEventCartesian].[PeriodTypeID] Is Null) Or ([qryEventCartesian].[PeriodFreq] Is Null) Or ([qryEventCartesian].[InstanceID] Is Null),[qryEventCartesian].[EventStart],DateAdd([qryEventCartesian].[PeriodTypeID],[qryEventCartesian].[InstanceID]*[qryEventCartesian].[PeriodFreq],[qryEventCartesian].[EventStart])),IIf([tblEventException].[IsCanned],Null,[tblEventException].[InstanceDate]))
 
You could try using a filter:

Me.Filter = "[EventDate] >=[Start Date] AND [EventDate]<=[End Date]"
Me.FilterOn = True

and place this code behind a button or in your AfterUpdate event for End Date.

You could also try adding a Criteria for the record source for the field EventDate:

Between [Start Date] And [End Date]

and in the AfterUpdate for End Date add Me.requery
 
Where do I enter this code. I do not see an AfterUpdate box in the properties window? Also, I tried to put it in the Filter and OnFilter but that did not work either? Again, thanks for you help.

George
 

Users who are viewing this thread

Back
Top Bottom