Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Access Splash Screen start up error

Hello,

I'm experiencing a slight difficulty with a Splash Screen I am trying to create for Microsoft Access, when it starts up, when you click on Lable Close I get an error message reading 'Compile error: User-defined type not defined', this appears at the prompt in the code I've highlighted in [b]Bold[/b]. Any help with this is very much received, I've gotten the code from an internet site that helps you design a Splash Screen. Many Thanks.


Option Compare Database
Option Explicit

Private Sub chkShowHide_BeforeUpdate(Cancel As Integer)

End Sub

Private Sub Form_Current()

End Sub

Private Sub lblClose_Click()
On Error GoTo Err_lblClose_Click

' Close the splash screen &
' Open the main database form, frmClients

DoCmd.Close
DoCmd.OpenForm "frmClients"

Exit_lblClose_Click:
Exit Sub

Err_lblClose_Click:
MsgBox Err.Description
Resume Exit_lblClose_Click

End Sub

Private Sub Form_Open(Cancel As Integer)

On Error GoTo FormOpen_Err
If (CurrentDb().Properties("StartupForm") = "frmSplashScreen" Or _
CurrentDb().Properties("StartupForm") = "Form.frmSplashScreen") Then
Forms!frmSplashScreen!chkHideSplash = False
Else
Forms!frmSplashScreen!chkShowHide = True
End If
FormOpen_Exit:
Exit Sub

FormOpen_Err:
If Err = 3270 Then
Forms!frmSplashScreen!chkShowHide = True
Resume FormOpen_Exit
End If

End Sub

Private Sub Form_Close()

On Error GoTo Form_Close_Err
If Forms!frmSplashScreen!chkShowHide Then
CurrentDb().Properties("StartupForm") = "frmClients"
Else
CurrentDb().Properties("StartupForm") = "frmSplashScreen"
End If
Exit Sub

Form_Close_Err:
If Err = 3270 Then
[b]Dim db As DAO.Database[/b]
Dim prop As DAO.Property
Set db = CurrentDb()
Set prop = db.CreateProperty("StartupForm", dbText, "frmSplashScreen")
db.Properties.Append prop
Resume Next
End If

End Sub












Comments

  • dokken2dokken2 Posts: 532Member

    : If Err = 3270 Then
    : [b]Dim db As DAO.Database[/b]
    : Dim prop As DAO.Property
    : Set db = CurrentDb()


    by default, newer versions of access set a reference to ADO, not DAO.

    go into a module or Visual Basic mode, click Tools, References,
    select [microsoft dao 3.6 object library]
  • rtrgrl78rtrgrl78 Posts: 9Member
    Hi,

    Thanks for that all is working now, my VB experience leaves a lot to be desired and needs a lot of working on! Cheers.



    : : If Err = 3270 Then
    : : [b]Dim db As DAO.Database[/b]
    : : Dim prop As DAO.Property
    : : Set db = CurrentDb()
    :
    :
    : by default, newer versions of access set a reference to ADO, not DAO.
    :
    : go into a module or Visual Basic mode, click Tools, References,
    : select [microsoft dao 3.6 object library]

  • NigelshawNigelshaw Posts: 1Member
    Hi

    I'm new here but a regular on a few other access sites under the same name for reference.

    I have a good module for splash screen creation to help take the iritation of creating them yourself as they do seem to be quite problematic.

    I'm not marketing here as I am responding with a related solution to offer help to other developers.

    My site is splashscreen.co.uk and acccis.co.uk/splashbuilder

    it will certainly help with splash screen issues. It will also register your needed references like dao etc


    Hope that helps

    nigelshaw



Sign In or Register to comment.