Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Splash Screen Help

Status
Not open for further replies.

Emilio5639

Instructor
Jun 25, 2011
1
0
0
US
I just started using Access, and I was trying to create a splash screen. I can get it to work in accdb but when I go to accda it hangs on the splash screen. Here is my codeing, if I can get some help, i would appreciate it.

Emilio


Sub Form_Open(Cancel As Integer)

Me.TimerInterval = 3500

End Sub

Sub Form_Timer()

If Me.TimerInterval <> 0 Then
Me.TimerInterval = 0
End If

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "Switchboard"
DoCmd.OpenForm stDocName, , , stLinkCriteria

DoCmd.Close acForm, "Startup"


End Sub
Sub Command9_Click()
On Error GoTo Err_Command9_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "KeyBypass Form"
DoCmd.OpenForm stDocName, , , stLinkCriteria
DoCmd.Close acForm, "Startup", acSaveNo
Exit_Command9_Click:
Exit Sub

Err_Command9_Click:
MsgBox Err.Description
Resume Exit_Command9_Click

End Sub
 
Not sure right away how to sort out, but it might help see what is going on if everything were typed like the following, as far as spacing, alignment, order.
Code:
Sub Form_Open(Cancel As Integer)
	Me.TimerInterval = 3500
End Sub

Sub Form_Timer()
	Dim stDocName As String
	Dim stLinkCriteria As String

	stDocName = "Switchboard"

	If Me.TimerInterval <> 0 Then
		Me.TimerInterval = 0
	End If
	
	DoCmd.OpenForm stDocName, , , stLinkCriteria

	DoCmd.Close acForm, "Startup"

End Sub

Sub Command9_Click()
On Error GoTo Err_Command9_Click
	Dim stDocName As String
	Dim stLinkCriteria As String

	stDocName = "KeyBypass Form"
	
	DoCmd.OpenForm stDocName, , , stLinkCriteria
	DoCmd.Close acForm, "Startup", acSaveNo

Exit_Command9_Click:
	Exit Sub

Err_Command9_Click:
	MsgBox Err.Description
	
	Resume Exit_Command9_Click

End Sub

...and in the Code box..
 
I might would change this:
Code:
If Me.TimerInterval <> 0 Then
        Me.TimerInterval = 0
End If

To just this:
Code:
Me.TimerInterval = 0

Reason being, if this code works, you'll be changing the timer interval to 0 (turning it off), and then closing the form anyway. So once it's hit the timer once, it'll never hit it again anyway - so that might help a little

I'll see if I can look back at this later and help with anything else...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top