make image visible? (1 Viewer)

bgseib

Registered User.
Local time
Today, 01:08
Joined
May 1, 2002
Messages
21
This will be easy for most probably... I have a button that calls 9 SP's in sequence, and I am wanting to display an image for the user while a sp is running and once it completes and the nest sp starts the image will go to invisible and the next image will become visible.
I am doing the same now with message boxes, but would like to change to images that automatically open and close for the viewer to have something to make the time go by faster...

sample so far:

cnn.execute ("sp_1")
MsgBox "stage 1"
cnn.execute ("sp_2")
MsgBox "stage 2"
cnn.execute ("sp_3")
MsgBox "stage 3"

etc.. I would like to change the message box to a image.. And ideas???

Thanks,
Brian
 

chrismcbride

Registered User.
Local time
Today, 01:08
Joined
Sep 7, 2000
Messages
301
I guess you could make a new unbound form. On this form place all the images you would like to display. Call the form as a Pop Up form when the procedure begins. Make all the images invisible at design time. Then just make them visible at each iteration of your procedure.

DoCmd.OpenForm "frmImages"


cnn.execute ("sp_1")
Forms!frmImages!image1.Visible = true
cnn.execute ("sp_2")
Forms!frmImages!image1.Visible = false
forms!frmImages!images2.Visible = true...
MsgBox "stage 2"
cnn.execute ("sp_3")
MsgBox "stage 3"

There may be syntax issues here and it may prove easier to put the images directly onto the form from which the SP's are being called.
HTH
Chris
 

bgseib

Registered User.
Local time
Today, 01:08
Joined
May 1, 2002
Messages
21
Won't really work..

Good idea - But it takes too long to refresh the screen. The sp's only take about 30 seconds, and by the time the visible property is set to false - the next sp is already complete. This is kind of what I was thinking though too.. Does ANYONE know how to have an image pop up and down with out using a form? Or maybe a way to set a refresh rate to every second or something like that??

Thanks for all the help
 

ghudson

Registered User.
Local time
Yesterday, 20:08
Joined
Jun 8, 2002
Messages
6,195
I use a custom Pause() function. It forces a four second pause which allows the images to show.

'copy this function into a module

Public Function Pause()
On Error GoTo Err_Pause
Dim PauseTime, Start
PauseTime = 4 ' = 4 seconds
Start = Timer
Do While Timer < Start + PauseTime
DoEvents
Loop
Exit_Pause:
Exit Function
Err_Pause:
MsgBox Me.Name, "Pause", Err.Number, Err.Description
Resume Exit_Pause

'Now all you have to do is type a "Pause" (no quotes) line in your code for a four second pause.

Pause 'this call the Pause () function

cnn.execute ("sp_1")
Pause 'this call the Pause () function
Forms!frmImages!image1.Visible = true
cnn.execute ("sp_2")
Pause 'this call the Pause () function
Forms!frmImages!image1.Visible = false
forms!frmImages!images2.Visible = true...
MsgBox "stage 2"
cnn.execute ("sp_3")
Pause 'this call the Pause () function
MsgBox "stage 3"

Put the Pause line where it works best for you. I believe that you should make the image visible before you run each SP.

HTH
 

Users who are viewing this thread

Top Bottom