View Single Post
  #3  
Old February 4th, 2010, 03:47 PM posted to microsoft.public.access.forms
JAmes
external usenet poster
 
Posts: 904
Default Getting a form to change on a timer

Hi Brendan
Adapted to use query and it works a treat. Thanks
Using the following code:

_______________________________________________
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
__________________________________________________ ____


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





"Brendan Reynolds" wrote:

"james" wrote in message
...
Hi,
I have a Form Called frmDisplay and it contains a Subform called
sbfrmDisplay. This subform displays the results of a query
QryDisplayOrder.

I wish to code the form so that the contents of sbfrmDisplay changes
between
4 queries. The one mentioned above and another query QryDisplayInterest,
QryDisplayInterestOther & QryDisplayOrderOther. I wish the contents to
change
every ten seconds.

Thanks for the help. regards
James



Here's an example ...

Private Sub Form_Activate()

Me.TimerInterval = 10000

End Sub

Private Sub Form_Timer()

Select Case Me.sfrTest.SourceObject
Case "table.college"
Me.sfrTest.SourceObject = "table.contact"
Case "table.contact"
Me.sfrTest.SourceObject = "table.group"
Case Else
Me.sfrTest.SourceObject = "table.college"
End Select

End Sub

In this example I've assigned tables directly to the SourceObject property.
This isn't something I'd generally do or recomend in a production
application, I'd use forms instead, I just didn't have suitable forms
available for testing the example.

--
Brendan Reynolds