By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,962 Members | 2,545 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,962 IT Pros & Developers. It's quick & easy.

IF THEN ELSE Query...

P: n/a
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.
Jan 3 '08 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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
Jan 3 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.