View Single Post
  #2  
Old February 4th, 2010, 12:29 PM posted to microsoft.public.access.forms
Brendan Reynolds
external usenet poster
 
Posts: 1,241
Default Getting a form to change on a timer

"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