can not quit access properly

adaniele

Registered User.
Local time
Today, 23:16
Joined
Jul 18, 2005
Messages
176
run-time error 2450 can not find login form

Hi all, thx 4 your time and hlp in advance.

Info:
I migrated a database from access 97 to xp. Everytingh worked perfect in 97.

Situation:
There is a login form. Once the user is logged in the login form is hidden and the main menu comes up. Here is the code for this action:
Code:
                If Me.username1.Value = "Mdaniel" Or Me.username1.Value = "Admin" Then
                    Form.Visible = False
                    For i = 1 To CommandBars.Count
                        CommandBars(i).Enabled = True
                    Next i
                    DoCmd.SelectObject acTable, , True
                    stDocName = "supermenu"
                    DoCmd.OpenForm stDocName, , , stLinkCriteria
                    If Me.username1.Value = "Admin" Then
                        vmac = Environ("username")
                        DoCmd.SetWarnings False
                        DoCmd.RunSQL ("insert into adminlog (mac,modon) values ('" & vmac & "','" & Now() & "');")
                        DoCmd.SetWarnings True
                    End If
                Else
                    Form.Visible = False
                    stDocName = "supermenu"
                    DoCmd.OpenForm stDocName, , , stLinkCriteria
                End If
There is an option in the main menu which is EXIT. The code for this option is:
Code:
docmd.quit

Problem:
for some reason when the user is not the admin or mdaniel, an error msg appears saying that the login form can not be found. However this form is still hidden.

any clue?
thx, max.
 
Last edited:
workround...
I make the database windows visible for all users and now the problem is gone.

The disadvantage is now they see the database window but they cant use it because i am using popup and modal YES.

Could somebody let me know , why it was working properly in access 97 and now i had to do this for access xp?

thx, max.
 
Have you tried changing Form.Visible = False to Me.Visible = False?
 
ruralguy, mate!!!!!!!!! u are a geniuos....

thx very much. max.
 
Nope...just took my best guess, but you are very welcome. Thanks for posting back with your success.
 

Users who are viewing this thread

Back
Top Bottom