MrDuke September 20, 2005 Share MrDuke Member September 20, 2005 Ok, I've got a program opening an Access database that auto-executes some code. MSA lets you autorun any macro that't titled 'autoexec'. Here's the goofy part: If I keep it in that format (trying to open the autoexec macro at startup) I get an error msg saying 'cannot find the file xxxx.mdb where xxxx is the name of the database. If I change the macro name from autoexec to anything else (defeating the autostart function), the initial program opens it fine and I have no errors. Anyone have any comments/tips? Link to comment Share on other sites More sharing options...
stutters September 20, 2005 Share stutters GC Alumni September 20, 2005 http://www.mysql.org c'mon duke. you were all alone out in the open. had to take the shot. Link to comment Share on other sites More sharing options...
MrDuke September 20, 2005 Author Share MrDuke Member September 20, 2005 The car that turns around in your driveway tonight isn't really lost... Link to comment Share on other sites More sharing options...
ScubaDan September 20, 2005 Share ScubaDan Member September 20, 2005 There's a support document at MS that might help Linky Link to comment Share on other sites More sharing options...
MrDuke September 20, 2005 Author Share MrDuke Member September 20, 2005 Go fish. TY though! Other thoughts before I crack the knuckles and get down to some creative and inefficient problem solving? Link to comment Share on other sites More sharing options...
ScubaDan September 20, 2005 Share ScubaDan Member September 20, 2005 Sorry Duke, the only time I hit that snag was with quit in the autoexec macro. Perhaps you should look into SJ's suggestion Link to comment Share on other sites More sharing options...
Guest zerodamage September 20, 2005 Share Guest zerodamage Guests September 20, 2005 Sorry man, haven't touched MS Access in 5+ years. Work mostly with Mysql now (with lots of help). Link to comment Share on other sites More sharing options...
DogStarMan September 21, 2005 Share DogStarMan Member September 21, 2005 Ok, I've got a program opening an Access database that auto-executes some code.MSA lets you autorun any macro that't titled 'autoexec'. Here's the goofy part: If I keep it in that format (trying to open the autoexec macro at startup) I get an error msg saying 'cannot find the file xxxx.mdb where xxxx is the name of the database. If I change the macro name from autoexec to anything else (defeating the autostart function), the initial program opens it fine and I have no errors. Anyone have any comments/tips? <{POST_SNAPBACK}> Which version of MS Access are you using? What exactly is the autoexec macro doing? I design databases in MS Access all the time and I've never seen this behavior. One sure that that will fix some of the very screwy stuff that Access does, is to create a new blank database and import all of your macros, forms, tables, etc into it. That might fix it. Link to comment Share on other sites More sharing options...
appalachian_fox September 21, 2005 Share appalachian_fox Member September 21, 2005 Duke, Make sure you have an explicit path in the autoexec file...I've noticed weird behavior with autoexec files in windows, sometimes it assumes a default path that is not what I would have though logical in any way. Another option, perhaps, is to rename the macro to something else and have the autoexec macro run that macro (iirc you can nest macros). Good luck! Link to comment Share on other sites More sharing options...
DogStarMan September 21, 2005 Share DogStarMan Member September 21, 2005 Make sure you have an explicit path in the autoexec file...I've noticed weird behavior with autoexec files in windows, sometimes it assumes a default path that is not what I would have though logical in any way.<{POST_SNAPBACK}> His macro was called autoexec. I don't think he was dealing with any actual autoexec.bt files or anything. Fox is right though, you can nest macros. What I do is use the autoexec macro to run a module, where I keep the code for the actions I want to take. Link to comment Share on other sites More sharing options...
appalachian_fox September 21, 2005 Share appalachian_fox Member September 21, 2005 Heh, son of a gun...I DID call it a file. I'm sorry, I was about to get really sarcastic and unfriendly...You know, like I often do Regardless, I meant macro. I also assumed you were using the macro to work between databases...just because of the xxxx.mdb. If you're not calling another db, then obviously paths are not an issue. Sorry, DSM! Seriously, I have never had an autoexec component work flawlessly right off the bat, whether it was a batch file or macro. I like DSM's idea, because it just seems more...segmented. More friendly to the evil code reuse bandit. Link to comment Share on other sites More sharing options...
MrDuke September 21, 2005 Author Share MrDuke Member September 21, 2005 If I embed the macro it still fails. It's stuck on the name. I'm gonna try converting it to a module and playing around with it some more. Link to comment Share on other sites More sharing options...
ZesteR September 22, 2005 Share ZesteR Member September 22, 2005 I know a good amount about Access 2003, but this is definitly new to me also. Make to let us know wats up and if ya fixed it... b/c I'm lost as you on this one. Link to comment Share on other sites More sharing options...
DogStarMan September 22, 2005 Share DogStarMan Member September 22, 2005 (edited) Heh, son of a gun...I DID call it a file. I'm sorry, I was about to get really sarcastic and unfriendly...You know, like I often do <{POST_SNAPBACK}> No harm no foul. Sarcastic and unfriendly, I can handle. It's stupidity I have a problem with. I forgot to mention that in my autoexec macro, all I have is one line, RunCode, and then I point it to the function that I want to run. A good way to test it is to create a function called test and then just have it do a msgbox "it works" or something like that. If you point to the function test from the RunCode command in your autoexec macro, then the message box should pop up when you open the database. If you want to convert your macro to a module, just highlight it and do a File-Save As and in the dropdown, select module instead of macro. That's probably the easiest way. There's a good list of run command method constants here. Edited September 22, 2005 by DogStarMan Link to comment Share on other sites More sharing options...
appalachian_fox September 23, 2005 Share appalachian_fox Member September 23, 2005 That is a really neat idea. I'm going to hold on to that, DSM... Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now