A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Form changes contents on a timer - how to get it to skip if nil re



 
 
Thread Tools Display Modes
  #1  
Old February 4th, 2010, 04:52 PM posted to microsoft.public.access.forms
JAmes
external usenet poster
 
Posts: 904
Default Form changes contents on a timer - how to get it to skip if nil re

Hi
The code below is for a form that changes contents on a timer. The contents
are received from a series of queries

Is there a way to make it so that if a query has nil results/records that it
automatically skips to the next Case/Query?

Cheers
James
_______________________________________________
Private Sub Form_Activate()
Me.TimerInterval = 5000

End Sub

Private Sub Form_Load()
Me.Child4.SourceObject = "Query.DisplayOrdersEURGBP"
Me.Label5.Caption = "EURGBP"
End Sub

Private Sub Form_Timer()

Select Case Me.Child4.SourceObject
Case "Query.DisplayOrdersEURGBP"
Me.Child4.SourceObject = "Query.DisplayOrdersEURUSD"
Me.Label5.Caption = "EURUSD"
Case "Query.DisplayOrdersEURUSD"
Me.Child4.SourceObject = "Query.DisplayOrdersGBPUSD"
Me.Label5.Caption = "GBPUSD"
Case "Query.DisplayOrdersGBPUSD"
Me.Child4.SourceObject = "Query.DisplayOrdersOther"
Me.Label5.Caption = "OTHER"
Case "Query.DisplayOrdersOther"
Me.Child4.SourceObject = "Query.DisplayOrdersEURGBP"
Me.Label5.Caption = "EURGBP"

End Select
End Sub
__________________________________________________ ____



  #2  
Old February 5th, 2010, 02:52 PM posted to microsoft.public.access.forms
Tom van Stiphout[_2_]
external usenet poster
 
Posts: 1,653
Default Form changes contents on a timer - how to get it to skip if nil re

On Thu, 4 Feb 2010 07:52:13 -0800, james
wrote:

You would have to first query the subforms to find out how many rows
there are. Or (but I like this less) run the same query as used for
the recordsource of the subforms.

What I might do is put these several subforms on a tab control, each
in their own tab. Then hide the actual tabs so it looks like just a
subform.
Now all subforms are open at all times, so you can easily get them to
requery and get their rowcount (using .RecordsetClone.RecordCount),
and you can use this info to decide which tab to activate.

-Tom.
Microsoft Access MVP




Hi
The code below is for a form that changes contents on a timer. The contents
are received from a series of queries

Is there a way to make it so that if a query has nil results/records that it
automatically skips to the next Case/Query?

Cheers
James
_______________________________________________
Private Sub Form_Activate()
Me.TimerInterval = 5000

End Sub

Private Sub Form_Load()
Me.Child4.SourceObject = "Query.DisplayOrdersEURGBP"
Me.Label5.Caption = "EURGBP"
End Sub

Private Sub Form_Timer()

Select Case Me.Child4.SourceObject
Case "Query.DisplayOrdersEURGBP"
Me.Child4.SourceObject = "Query.DisplayOrdersEURUSD"
Me.Label5.Caption = "EURUSD"
Case "Query.DisplayOrdersEURUSD"
Me.Child4.SourceObject = "Query.DisplayOrdersGBPUSD"
Me.Label5.Caption = "GBPUSD"
Case "Query.DisplayOrdersGBPUSD"
Me.Child4.SourceObject = "Query.DisplayOrdersOther"
Me.Label5.Caption = "OTHER"
Case "Query.DisplayOrdersOther"
Me.Child4.SourceObject = "Query.DisplayOrdersEURGBP"
Me.Label5.Caption = "EURGBP"

End Select
End Sub
_________________________________________________ _____


 




Thread Tools
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 Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 09:44 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.