Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2008
    Posts
    2

    Access 2000 programming startup options

    Hello all,

    I require some VB coding help if possible.

    I have a login screen (frmLogin), where the users enter username / password combination and click an Enter button. The following code is then attributed to the onclick event of that button



    Code:
     
    Private Sub cmdEnter_Click()
    Dim dbs As CurrentProject
    Set dbs = Application.CurrentProject
        If txtUser.Value = "Admin" And txtPass.Value = "admin" Then
     
            dbs.Properties(StartUpForm) = "Switchboard"
            dbs.Properties(StartUpShowDBWindow) = True
     
        ElseIf txtUser.Value = "Normal" And txtPass.Value = "normal" Then
     
            dbs.Properties(StartUpForm) = "Switchboard"
            dbs.Properties(StartUpShowDBWindow) = False
            dbs.Properties(AllowFullMenus) = False
            dbs.Properties(AllowSpecialKeys) = False
     
        Else
     
            MsgBox "Password Invalid. Please Try Again", vbOKOnly, "Invalid Entry!"
     
        End If
     
     
    End Sub
    When I click Enter I get an error message:

    "Runtime Error 2467. The expression you entered refers to an object that is closed or doesn't exist"

    and when I click debug, it always highlights the first line of each if statement the

    Code:
    dbs.Properties(StartUpForm) = "Switchboard"
    I apologise for what I presume is poor coding, as I am not particulary versed in this type, I am only comfortable with basic selection statement and msg box type programming. Am I right is assuming that some type of object declarations are needed? I also realsise that hardcoding in the username and password is not best practice, but I just want to use these for testing.

    If anyone could provide some more assistance that would be great.

    Thanks,

    nosaj
    Last edited by nosaj_ccfc; 09-04-2008 at 04:09 AM. Reason: code tags

  2. #2
    Squeaner is offline Novice
    Windows 7 Access 2007
    Join Date
    Jul 2008
    Posts
    2
    Were you able to get this work? If you have I would love to know the code for it if at all possible. I'm looking for the same function.

    Thanks.

    --
    Sincerely,
    Brian McDonald

  3. #3
    Join Date
    Sep 2008
    Posts
    2
    Quote Originally Posted by Squeaner View Post
    Were you able to get this work? If you have I would love to know the code for it if at all possible. I'm looking for the same function.

    Thanks.

    --
    Sincerely,
    Brian McDonald
    Brian,

    I have since left the company I was doing the work for (contractor) so I never finished the project myself. I never found a solution however

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Programming Language like Access
    By cwf in forum Programming
    Replies: 2
    Last Post: 05-17-2008, 03:02 AM
  2. Access Programming and Access Data Page
    By frmdread67 in forum Programming
    Replies: 0
    Last Post: 03-19-2008, 03:11 PM
  3. very slow when connect to access 2000
    By pureland in forum Access
    Replies: 0
    Last Post: 10-23-2007, 05:42 AM
  4. Bypassing Startup options with Ctrl W
    By rayc in forum Security
    Replies: 0
    Last Post: 09-06-2006, 09:18 AM
  5. Replies: 1
    Last Post: 05-14-2006, 09:01 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums