=SetTimer()

D

Dennis Que

Access 97 used the SetTimer function on its startup screen for Loge and
other information. I tried to use this in Access 2000 and it would not work.
Does anyone know what replaced the "SetTimer" that was in 2000.
________________________________
Function SetTimer()
' Set the timer for 10 seconds.
Forms![Startup].TimerInterval = 1000
End Function

Function CloseNewStartupfrom()
Reset the TimerInterval property.
If Forms! [Startup]. TimerInterval <> 0 then
Forms![Startup].TimerInterval = 0
End If
' Close the Startup form, and open the Main Switchboard form.
DoCmd.OpenForm "Main switchboard"
DoCmd.Close acForm. "Startup"

End Function
 
G

Graham R Seach

Dennis,

There never was a SetTimer function, in any version of Access. The SetTimer
function you have was custom written by someone.

If it isn't working in your application, then perhaps the form name is
different. Change the word "Startup" in the following line:
Forms![Startup].TimerInterval = 1000

....to the name of your start-up form. Do the same thing in
CloseNewStartupfrom().

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia

Microsoft Access 2003 VBA Programmer's Reference
http://www.wiley.com/WileyCDA/WileyTitle/productCd-0764559036.html
 
A

Allan Murphy

Dennis

This is code that I use to display a splash screen i.e. Logo etc for a
period of 5 seconds then open the switchboard.

The form is my splash form and this is the code on the form.

Private Sub Form_Load()

DoCmd.Maximize
Me.TimerInterval = 5000

End Sub

Private Sub Form_Timer()

' If statement used by Developer Solutions to reset TimerInterval
property.
If Me.TimerInterval <> 0 Then
Me.TimerInterval = 0
End If
' Call DisplayStartup procedure to determine the setting of
' the DisplayStartupForm custom database property.

DoCmd.OpenForm "Switchboard", , , , acNormal

DoCmd.Close acForm, "frm_splash"
End Sub

NOTE: TimerInterval is in milliseconds where 5000 is a time period of 5
seconds.

Allan Murphy

Email: (e-mail address removed)
 
R

RuralGuy

Dennis Que said:
Access 97 used the SetTimer function on its startup screen for Loge
and other information. I tried to use this in Access 2000 and it would
not work. Does anyone know what replaced the "SetTimer" that was in
2000.
________________________________
Function SetTimer()
' Set the timer for 10 seconds.
Forms![Startup].TimerInterval = 1000
End Function

Function CloseNewStartupfrom()
Reset the TimerInterval property.
If Forms! [Startup]. TimerInterval <> 0 then
Forms![Startup].TimerInterval = 0
End If
' Close the Startup form, and open the Main Switchboard form.
DoCmd.OpenForm "Main switchboard"
DoCmd.Close acForm. "Startup"

End Function

Hi Dennis,

TimerInterval is still a property of every form. My guess is you
re-typed the above code since there are spaces in it that would give
you errors. Also, a TimerInterval of 1000 is one second, not 10
seconds.

I hope you know that the "Startup" form could perform all of this
on its own and launch the "Main switchboard" and then close itself.
It looks to me as though this code was intended for a standard module
which is unnecessary.

How about letting us know what you would like to achieve and maybe
someone can give you some additional pointers.

HTH
 
B

Brendan Reynolds

In addition to the advice you have received from others, there is an
apostraphe missing from in front of a line that is clearly intended to be a
comment ...

Function CloseNewStartupfrom()
Reset the TimerInterval property.

.... should be ...

Function CloseNewStartupfrom()
' Reset the TimerInterval property.

There's also a typo in the function name , 'from' instead of 'form'.

Are you retyping code into the newsgroup posts? If so, that's generally not
a good idea, as we end up a) debugging errors that exist only in the
newsgroup post, not in the real code and b) we never see errors that exist
in the real code but not in the re-typed newsgroup post. If that's what's
happening, try copying and pasting the actual code instead of re-typing.

--
Brendan Reynolds (MVP)

Allan Murphy said:
Dennis

This is code that I use to display a splash screen i.e. Logo etc for a
period of 5 seconds then open the switchboard.

The form is my splash form and this is the code on the form.

Private Sub Form_Load()

DoCmd.Maximize
Me.TimerInterval = 5000

End Sub

Private Sub Form_Timer()

' If statement used by Developer Solutions to reset TimerInterval
property.
If Me.TimerInterval <> 0 Then
Me.TimerInterval = 0
End If
' Call DisplayStartup procedure to determine the setting of
' the DisplayStartupForm custom database property.

DoCmd.OpenForm "Switchboard", , , , acNormal

DoCmd.Close acForm, "frm_splash"
End Sub

NOTE: TimerInterval is in milliseconds where 5000 is a time period of 5
seconds.

Allan Murphy

Email: (e-mail address removed)


Dennis Que said:
Access 97 used the SetTimer function on its startup screen for Loge and
other information. I tried to use this in Access 2000 and it would not work.
Does anyone know what replaced the "SetTimer" that was in 2000.
________________________________
Function SetTimer()
' Set the timer for 10 seconds.
Forms![Startup].TimerInterval = 1000
End Function

Function CloseNewStartupfrom()
Reset the TimerInterval property.
If Forms! [Startup]. TimerInterval <> 0 then
Forms![Startup].TimerInterval = 0
End If
' Close the Startup form, and open the Main Switchboard form.
DoCmd.OpenForm "Main switchboard"
DoCmd.Close acForm. "Startup"

End Function
 
D

Dennis Que

Thank you Guys for your help. I corrected the typo's in the code and it
worked well.

Brendan Reynolds said:
In addition to the advice you have received from others, there is an
apostraphe missing from in front of a line that is clearly intended to be a
comment ...

Function CloseNewStartupfrom()
Reset the TimerInterval property.

... should be ...

Function CloseNewStartupfrom()
' Reset the TimerInterval property.

There's also a typo in the function name , 'from' instead of 'form'.

Are you retyping code into the newsgroup posts? If so, that's generally not
a good idea, as we end up a) debugging errors that exist only in the
newsgroup post, not in the real code and b) we never see errors that exist
in the real code but not in the re-typed newsgroup post. If that's what's
happening, try copying and pasting the actual code instead of re-typing.

--
Brendan Reynolds (MVP)

Allan Murphy said:
Dennis

This is code that I use to display a splash screen i.e. Logo etc for a
period of 5 seconds then open the switchboard.

The form is my splash form and this is the code on the form.

Private Sub Form_Load()

DoCmd.Maximize
Me.TimerInterval = 5000

End Sub

Private Sub Form_Timer()

' If statement used by Developer Solutions to reset TimerInterval
property.
If Me.TimerInterval <> 0 Then
Me.TimerInterval = 0
End If
' Call DisplayStartup procedure to determine the setting of
' the DisplayStartupForm custom database property.

DoCmd.OpenForm "Switchboard", , , , acNormal

DoCmd.Close acForm, "frm_splash"
End Sub

NOTE: TimerInterval is in milliseconds where 5000 is a time period of 5
seconds.

Allan Murphy

Email: (e-mail address removed)


Dennis Que said:
Access 97 used the SetTimer function on its startup screen for Loge and
other information. I tried to use this in Access 2000 and it would not work.
Does anyone know what replaced the "SetTimer" that was in 2000.
________________________________
Function SetTimer()
' Set the timer for 10 seconds.
Forms![Startup].TimerInterval = 1000
End Function

Function CloseNewStartupfrom()
Reset the TimerInterval property.
If Forms! [Startup]. TimerInterval <> 0 then
Forms![Startup].TimerInterval = 0
End If
' Close the Startup form, and open the Main Switchboard form.
DoCmd.OpenForm "Main switchboard"
DoCmd.Close acForm. "Startup"

End Function
 

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