Open Each Form Sequentially

boats02

Registered User.
Local time
Today, 07:46
Joined
Dec 20, 2001
Messages
14
Good Afternoon:

I am trying to write a module that will open all forms one at a time and keep each open for 60 seconds before moving to the next form.

The code should be dynamic and automaticlly open each form, no matter how many forms are in the database.

The end result would be something like Powerpoint. I would cycle through the forms that would report real time sales out of the database.

Can anyone assist?

Any suggestions of assistance would be greatly appreciated.

Thanks in advance.

Brian Rollins
 
Opps, I should mention that this would be done while all forms are currently closed. That is to say, there aren't any forms in the forms collection.

I tried opening all forms first and then cycling with:
For each Form in Forms

The application hangs because each form takes up so much memory and resources.

Instead, I wanted to open a form and then close it before moving to the next form



[This message has been edited by boats02 (edited 03-08-2002).]
 
I have a feeling using reports instead of forms is going to be a little less memory intensive. I don't know the direct answer to your question, but the purpose escapes me, so good luck...

David R
 
Just a little background on my project.
I have designed an access database that records new sales for all the sales reps in our department.

I've had a monitor installed high on the wall so that everyone can see it. I want a separate Access DB (with linked tables to the sales log) to rotate through forms on the monitor. Each form would display different data. One might show the top sales reps in real time, the next might show sales per region etc.

I'd like to use PowerPoint instead, but haven't found a way to actively link/embed Access Charts into PowerPoint without updating them manually.

You might be correct. Maybe a report is better than a form.

Keep the suggestions coming.

Thanks.

Brian Rollins.


[This message has been edited by boats02 (edited 03-08-2002).]
 
You could try the following to get you started.

Create a table called Forms with one text field called FormName

Then the following will loop through all the forms in the table holding them open for the determined period which is T

Public Sub LoopForms()
Dim dbs As Database
Dim rst As Recordset
Dim frm As Form
Dim a
Dim StartTime
Dim EndTime
Dim T

Set dbs = CurrentDb
Set rst = dbs.OpenRecordset("Forms", dbOpenDynaset)
T = 20

rst.MoveFirst
Do Until rst.EOF

a = rst!FormName
DoCmd.OpenForm a, acNormal, "", "", acFormReadOnly, acWindowNormal

StartTime = Timer
EndTime = StartTime + T

TimeLoop:

If EndTime > Timer Then
GoTo TimeLoop
End If
DoCmd.Close acForm, a

rst.MoveNext
Loop

rst.Close
dbs.Close

End Sub

All you need to do is decide how long you want the forms open for and if you want to run continiously constantly loop the whole procedure. Don't forget though you will need a way of stopping it at the end of the day!!

HTH
John
 

Users who are viewing this thread

Back
Top Bottom