syscmd progress meter with a splash screen

G

Guest

When the DB opens a splash screen opens and I have some code to update some
tables using ADO.

As this can take some time in some instances, I thought it would be a good
idea for a progress meter to be displayed using the SysCmd function.

Unfortunately, the progress meter doesn't appear. I have stepped through
the code but have been unable to figure out why it doesn't appear to work.

At present the border style is set to Dialog, but I have tried the other
options without any success.

See the code below:

Option Compare Database
Option Explicit

Private Sub Form_Current()

Dim dteLastStdDate As Date
Dim varReturn As Variant

'=========================================================
'update the table zstlkpStdDates

'display progress meter
varReturn = Application.SysCmd(acSysCmdInitMeter, "Updating System
Tables", 200)

'get the last date in that table
dteLastStdDate = GetLastDateInStdDates()

'update progress meter to 25%
varReturn = Application.SysCmd(acSysCmdUpdateMeter, , 50)

'now update the table from the next day
Call InsStdDates(DateAdd("d", 1, dteLastStdDate))

'update progress meter to 100%
varReturn = Application.SysCmd(acSysCmdUpdateMeter, , 200)

'remove progress meter
varReturn = Application.SysCmd(acSysCmdRemoveMeter)

'=========================================================

End Sub

Private Sub Form_Load()

DoCmd.Maximize

End Sub


Private Sub Form_Timer()


DoCmd.Close
DoCmd.OpenForm "fdlgMainSwitchboard", , , , acFormReadOnly

End Sub
 
G

Guest

Ross, try
varReturn = Application.SysCmd(acSysCmdUpdateMeter, 50)
I would have thought that the meter would have been initialised as the
initialisation line looks ok. I never use the function version only (the
purists may think this naughty).
SysCmd acSysCmdUpdateMeter, 50
Terry
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top