dbTalk Databases Forums  

IF THEN ELSE Query...

comp.databases.ms-access comp.databases.ms-access


Discuss IF THEN ELSE Query... in the comp.databases.ms-access forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
AccessGuy
 
Posts: n/a

Default IF THEN ELSE Query... - 01-03-2008 , 03:04 PM






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.

Reply With Quote
  #2  
Old   
Salad
 
Posts: n/a

Default Re: IF THEN ELSE Query... - 01-03-2008 , 03:54 PM






AccessGuy wrote:
Quote:
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


Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.