PDA

View Full Version : Reloaded Access; macros do not work



MWE
08-29-2005, 11:04 AM
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:

Private Sub TodaysDate_Click()

MsgBox "TodaysDate_Click"

End Sub

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:dunno:dunno. 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.:banghead: 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?

xCav8r
08-29-2005, 07:30 PM
So, what might have been going on?
You've been using Access!

MWE
08-29-2005, 07:36 PM
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.

xCav8r
08-29-2005, 09:21 PM
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?

MWE
08-30-2005, 08:39 AM
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:banghead:

xCav8r
09-19-2005, 07:10 PM
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.

MWE
09-21-2005, 05:21 AM
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?

xCav8r
09-21-2005, 06:24 AM
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/assistance/HP030704101033.aspx
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odeopg/html/deovraccessuserlevelsecurity.asp

HTH! :)