IF THEN ELSE Query...
am 03.01.2008 21:04:57 von AccessGuy
Happy New Year All!
I have 2 queries, a qry_HISTData and qry_RAWData. qry_RAWData is
automatically triggered from a subform using the "asofdate" of the
mainform as a date parameter. What I'm attempting is to have the
subform trigger qry_HISTData when the mainform's "asofdate" is older
than the current date. Is this possible? If so how? I thought
perhaps using IF THEN ELSE but I am unfamiliar with how to do this
using SQL. Any help is appreciated. Thank you.
Re: IF THEN ELSE Query...
am 03.01.2008 21:54:17 von Salad
AccessGuy wrote:
> Happy New Year All!
>
> I have 2 queries, a qry_HISTData and qry_RAWData. qry_RAWData is
> automatically triggered from a subform using the "asofdate" of the
> mainform as a date parameter. What I'm attempting is to have the
> subform trigger qry_HISTData when the mainform's "asofdate" is older
> than the current date. Is this possible? If so how? I thought
> perhaps using IF THEN ELSE but I am unfamiliar with how to do this
> using SQL. Any help is appreciated. Thank you.
I suppose you could put code similar to the following in the AfterUpdate
event of AsOfDate.
Dim strSource As String
strSource = IIF(Me.AsOfDate <=- Date(),"qry_RAWData","qry_HISTData")
Forms!MainFormName!SubFormName.Form.Recordsource = strSource
Palm trees
http://www.youtube.com/watch?v=J0oyIPXvw5w