Automate - open and close forms using a loop

Lee Babbage

New member
Local time
Today, 12:54
Joined
Aug 4, 2006
Messages
5
Hi

I am trying to automate the opening and closing of a set number of forms using a loop or recordset.

The recordet needs to go through and open each form and close the form within a certain amount of time - say 10 minutes and then open the next form in the loop.

I have racked my brains and have not been able to come up with a solution yet. I need to put this on a plasma screen hence scrolling through a number of forms so as not to burn out the TV.

HELP !!!!
 
Use the Timer event, this will allow you to close the current and open next form AND let you work with time...

If you are worried abou burning the screen, why not use windows screensaver?
 
Hi,

I feel this should be simple enough, based on the requirement. The first time, you open the first form. Choose a close event. i.e, write a vba code to close the form. Before close, open the next form.

The first code loads the form with a timer intervel. After the interval, it closes while opening the next one. I hope you can put this in a loop too.

Code:
Sub Form_Load()
    Me.TimerInterval = 1000
End Sub
Code:
Private Sub Form_Timer()
   Me.Text2 = Me.Text2 - 1

        If Me.Text2 = 0 Or Me.Text2 < 0 Then
        DoCmd.Close
        End If

End Sub
Code:
Private Sub Form_Close()
Form_Welcome.Visible = True
End Sub

You would need a textbox in the form(which can be hidden) for time interval.
 
code in loop

I know the logistics around it, just getting stuck on coding it into a loop as well.

Cant use a screensaver, as this plasma will be on the sales floor and they need to see the forms throughout the day with their sales figures on it.
 
Form1 > Form2 > Form3 > Form4 > Form1
= Loop right??
 
recordset

I was thinkin more of a loop using a recordset of form names coming from a query def.

Looping through the recordset opening the forms, closing them on a time interval and then opening the next form from the recordset - etc.

This will happen thoughout the day.
 
Why in the world do you want to complicate things? Mailman's answer is by far the easiest to implement!
 
being Friday and tired

How would I implement mailman's idea.

I am fine with the easier ways to skin the darn cat !!! Just want to get it done. Deadline today on this.
 
Well... I will repeat my first post if you like...

Or quote praveen_khm ?? He provided you some code... What about that dont you get?
 

Users who are viewing this thread

Back
Top Bottom