Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old August 25th, 2008, 02:59 PM
Registered User
 
Join Date: Aug 2008
Location: , , Belgium.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default runtime error 2450

I have a database with a login system.
Every time I want to close the database, I get a runtime error 2450 telling me that it can't find the frmLogin.
I don't know why it says that...
Can anyone help me, please?

code for both forms (frmLogin = Login form and frmStartpagina = start page, coming when you succesfully logged in) is below.

frmLogin:
Code:
Option Compare Database
Option Explicit

Private Sub cmdLogin_Click()

    If IsNull(Me.txtLogin) Then
        MsgBox "Geef uw gebruikersnaam in"
        Exit Sub
    ElseIf IsNull(Me.txtPaswoord) Then
        MsgBox "U moet een paswoord ingeven"
        Exit Sub
    End If

    If Me.txtPaswoord.Value = DLookup("Paswoord", "tblLogin", "Gebruikersnaam = '" & Me.txtLogin.Value & "'") Then
        Me.Visible = False 'Geopend maar niet zichtbaar.
        DoCmd.OpenForm "frmStartpagina", acNormal
    Else
        MsgBox "Ongeldig paswoord", vbExclamation
    End If

End Sub
frmStartpagina
Code:
Option Compare Database
Option Explicit

Private Sub cmdAfsluiten_Click()
    DoCmd.OpenForm "frmLogin"
    DoCmd.Quit acQuitPrompt

End Sub

Private Sub cmdAgenda_Click()
    Const strFullpath As String = "c:\Access cursus\DTC Agenda.mdb"
    Dim accappl As Access.Application

    Set accappl = New Access.Application

    accappl.OpenCurrentDatabase strFullpath
End Sub

Private Sub cmdKracht_Click()
Const strFullpath As String = "c:\Access cursus\Krachtschema.mdb"
    Dim accappl As Access.Application

    Set accappl = New Access.Application

    accappl.OpenCurrentDatabase strFullpath
End Sub

Private Sub cmdLegertesten_Click()
    Const strFullpath As String = "c:\Access cursus\Legertesten.mdb"
    Dim accappl As Access.Application

    Set accappl = New Access.Application

    accappl.OpenCurrentDatabase strFullpath
End Sub

Private Sub cmdLichaamsmetingen_Click()
    Const strFullpath As String = "c:\Access cursus\Lichaamsmetingen.mdb"
    Dim accappl As Access.Application

    Set accappl = New Access.Application

    accappl.OpenCurrentDatabase strFullpath
End Sub

Private Sub cmdMedisch_Click()
    Const strFullpath As String = "c:\Access cursus\Medisch.mdb"
    Dim accappl As Access.Application

    Set accappl = New Access.Application

    accappl.OpenCurrentDatabase strFullpath
End Sub

Private Sub cmdMentaal_Click()
    Const strFullpath As String = "c:\Access cursus\Mentaal.mdb"
    Dim accappl As Access.Application

    Set accappl = New Access.Application

    accappl.OpenCurrentDatabase strFullpath
End Sub

Private Sub cmdScouting_Click()
    Const strFullpath As String = "c:\Access cursus\Scouting 2008.mdb"
    Dim accappl As Access.Application

    Set accappl = New Access.Application

    accappl.OpenCurrentDatabase strFullpath
End Sub

Private Sub cmdSnelheidstesten_Click()
    Const strFullpath As String = "c:\Access cursus\Snelheidstesten.mdb"
    Dim accappl As Access.Application

    Set accappl = New Access.Application

    accappl.OpenCurrentDatabase strFullpath
End Sub

Private Sub cmdTornooiverslag_Click()
    Const strFullpath As String = "c:\Access cursus\Tornooiverslag.mdb"
    Dim accappl As Access.Application

    Set accappl = New Access.Application

    accappl.OpenCurrentDatabase strFullpath
End Sub

Private Sub cmdVideo_Click()
    Const strFullpath As String = "c:\Access cursus\Video.mdb"
    Dim accappl As Access.Application

    Set accappl = New Access.Application

    accappl.OpenCurrentDatabase strFullpath
End Sub

Private Sub cmdVoeding_Click()
    Const strFullpath As String = "c:\Access cursus\Voeding.mdb"
    Dim accappl As Access.Application

    Set accappl = New Access.Application

    accappl.OpenCurrentDatabase strFullpath
End Sub

Private Sub cmdWeekplanning_Click()
    Const strFullpath As String = "c:\Access cursus\Weekplanning.mdb"
    Dim accappl As Access.Application

    Set accappl = New Access.Application

    accappl.OpenCurrentDatabase strFullpath
End Sub

Private Sub Form_Load()

     Dim strLogin As String

' SELECT tblLogin.LoginID, tblLogin.Gebruikersnaam, tblLogin.Paswoord, tblLogin.Weekplanning,
' tblLogin.Tornooiverslag, tblLogin.Scouting, tblLogin.Video, tblLogin.Medisch, tblLogin.Mentaal,
' tblLogin.Voeding, tblLogin.Lichaamsmetingen, tblLogin.DTC_Agenda, tblLogin.Snelheidstesten,
' tblLogin.Kracht, tblLogin.Legertesten
' FROM tblLogin;

    strLogin = Forms("frmLogin").txtLogin
    Me.cmdScouting.Enabled = DLookup("Scouting", "tblLogin", "Gebruikersnaam = '" & strLogin & "'")
    Me.cmdTornooiverslag.Enabled = DLookup("Tornooiverslag", "tblLogin", "Gebruikersnaam = '" & strLogin & "'")
    Me.cmdVideo.Enabled = DLookup("Video", "tblLogin", "Gebruikersnaam = '" & strLogin & "'")
    Me.cmdWeekplanning.Enabled = DLookup("Weekplanning", "tblLogin", "Gebruikersnaam = '" & strLogin & "'")
    Me.cmdMentaal.Enabled = DLookup("Mentaal", "tblLogin", "Gebruikersnaam = '" & strLogin & "'")
    Me.cmdVoeding.Enabled = DLookup("Voeding", "tblLogin", "Gebruikersnaam = '" & strLogin & "'")
    Me.cmdLichaamsmetingen.Enabled = DLookup("Lichaamsmetingen", "tblLogin", "Gebruikersnaam = '" & strLogin & "'")
    Me.cmdKracht.Enabled = DLookup("Kracht", "tblLogin", "Gebruikersnaam = '" & strLogin & "'")
    Me.cmdSnelheidstesten.Enabled = DLookup("Snelheidstesten", "tblLogin", "Gebruikersnaam = '" & strLogin & "'")
    Me.cmdLegertesten.Enabled = DLookup("Legertesten", "tblLogin", "Gebruikersnaam = '" & strLogin & "'")
    Me.cmdAgenda.Enabled = DLookup("DTC_Agenda", "tblLogin", "Gebruikersnaam = '" & strLogin & "'")
    Me.cmdMedisch.Enabled = DLookup("Medisch", "tblLogin", "Gebruikersnaam = '" & strLogin & "'")

End Sub
Thanks in advance for your help!

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
hi i got runtime error 13 Type Mismatch error sriharsha345 Access VBA 2 February 21st, 2008 09:30 AM
Combine fields>Runtime error 2450 Chris333 Access VBA 4 July 6th, 2007 07:10 AM
run-time error '2450' kk_sg Access VBA 2 August 21st, 2006 10:26 AM
Run-time error '2450' bmurrin Access VBA 6 May 31st, 2006 07:11 AM
Can't find subform referred to in VBA Error 2450 mmcdonal Access VBA 2 April 18th, 2005 10:05 AM



All times are GMT -4. The time now is 11:38 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.