Consulting

Results 1 to 8 of 8

Thread: Reloaded Access; macros do not work

  1. #1
    VBAX Expert
    Joined
    Feb 2005
    Posts
    929
    Location

    Reloaded Access; macros do not work

    I recently loaded Access2000 on a new computer (running WinXP/SP2). It is the same version of Access as was running on the old computer (running WinXP/SP1). None of the macros that ran fine on the old computer run on the new one. In fact, although the macros are clearly evident in the VBE, when I click on their relevant command button I get an error suggesting that either the macro does not exist or there is some faulty linkage between the command button and the macro. For example, I have a form with a dozen or so command buttons. One button is named "TodaysDate". The corresponding macro has been reduced to:
    [VBA]
    Private Sub TodaysDate_Click()

    MsgBox "TodaysDate_Click"

    End Sub
    [/VBA]
    When I click on the button, an error message appears stating:

    The expression On Click you entered as the event property setting produced the following error: Variable not defined


    • The expression may not result in the name of a macro, the name of a user-defined function, or [Event Procedure]
    • There may have been an error evaluating the function, event or macro
    When I explore button properties, On-Click takes me right to the appropriate macro.

    Any help would be appreciated.

    UPDATE: well, it gets even stranger ...
    assuming that there was some flag/option/something that needed to be toggled, I explored just about any menu that might have something to irritate me. Found nothing.

    I then went back and tried to edit one of the malfunction macros and was told that I did not have exclusive access to the DB and any changes would be lost. I did not get that error previously. So I looked at the file owner and noticed that it was the admin group on my machine vs an individual owner. I run as administrator only when I need to do something scarey and run as me other times (I am a member of the admin group). I tried to change the owner to "me", but no dice. So, I logged off and logged in as the administrator and tried the same macros -- same error. I then tried to change the VBA code(just to see what would happen) and Access let me do that without any complaining. I undid that one edit and went back to the main form ... and then a miracle happened -- all the macros ran fine. So I exited the program, logged off as administrator and logged back on as "me". And, you guessed it -- everything works fine.

    So, what might have been going on?
    "It's not just the due date that's important, it's also the do date" [MWE]

    When your problem has been resolved, mark the thread SOLVED by clicking on the Thread Tools dropdown menu at the top of the thread.

  2. #2
    VBAX Expert xCav8r's Avatar
    Joined
    May 2005
    Location
    Minneapolis, MN, USA
    Posts
    912
    Location
    Quote Originally Posted by MWE
    So, what might have been going on?
    You've been using Access!

  3. #3
    VBAX Expert
    Joined
    Feb 2005
    Posts
    929
    Location
    Quote Originally Posted by xCav8r
    You've been using Access!
    well, that may be true; and your "explanation" may be true as well. But this is the first time in close to 10 years of using Access that something this weird has happened. I will admit that my Access skills would not even register on the Access Skill Index.
    "It's not just the due date that's important, it's also the do date" [MWE]

    When your problem has been resolved, mark the thread SOLVED by clicking on the Thread Tools dropdown menu at the top of the thread.

  4. #4
    VBAX Expert xCav8r's Avatar
    Joined
    May 2005
    Location
    Minneapolis, MN, USA
    Posts
    912
    Location
    A shot at humor, but I have had a few inexplicable problems with Access before that magically went away.

    Anyway, when you're talking about logging off and on, are you talking about to the database or windows?

  5. #5
    VBAX Expert
    Joined
    Feb 2005
    Posts
    929
    Location
    Quote Originally Posted by xCav8r
    A shot at humor, but I have had a few inexplicable problems with Access before that magically went away.

    Anyway, when you're talking about logging off and on, are you talking about to the database or windows?
    I tried closing the DB and exiting Access a few times, but that did nothing. It was only after I logged off (Windows) as me and logged on as the Administrator that things started to work. I still do not understand why the DB file is owned by the "Admin Group" and not by an individual; and I seem unable to change that
    "It's not just the due date that's important, it's also the do date" [MWE]

    When your problem has been resolved, mark the thread SOLVED by clicking on the Thread Tools dropdown menu at the top of the thread.

  6. #6
    VBAX Expert xCav8r's Avatar
    Joined
    May 2005
    Location
    Minneapolis, MN, USA
    Posts
    912
    Location
    Sorry, I meant to reply to this a while ago and had forgotten about it until you posted a reference to this thread. If you're talking about the workjet security system in Access, the default owner is admin, because that's what you're logging into the database as unless you set up your own workgroup.

  7. #7
    VBAX Expert
    Joined
    Feb 2005
    Posts
    929
    Location
    Quote Originally Posted by xCav8r
    Sorry, I meant to reply to this a while ago and had forgotten about it until you posted a reference to this thread. If you're talking about the workjet security system in Access, the default owner is admin, because that's what you're logging into the database as unless you set up your own workgroup.
    I assume by "admin" you mean the "computer administrator" group as defined by the OpSys. If so, why would Access make that group the default owner? And why would I (logged on not as the administrator but as a member of the computer administrator group) not be able to "change things", but the true administrator could? I can only remember 3 other times where a member of the administrator group could not do something and the true administrator could:
    1. installing Partition Magic
    2. working with certain OpSys process monitoring tools
    3. fiddling with OpSys security settings
    I can understand why those operations might exclude anyone other than the true administrator, but Access?
    "It's not just the due date that's important, it's also the do date" [MWE]

    When your problem has been resolved, mark the thread SOLVED by clicking on the Thread Tools dropdown menu at the top of the thread.

  8. #8
    VBAX Expert xCav8r's Avatar
    Joined
    May 2005
    Location
    Minneapolis, MN, USA
    Posts
    912
    Location
    I think you're confusing Window's security with the User Level Security (Microsoft Jet) used by Access. These might come in handy...

    http://office.microsoft.com/en-us/as...704101033.aspx
    http://msdn.microsoft.com/library/de...elsecurity.asp

    HTH!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •