473,408 Members | 2,734 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

Why does it take VBA onaction syntax to resolve error for inelegant powerdown?

In the 2007 help files examples provided for onaction syntax look like
.onaction = "DoAction"

Recently my computer powered down inelegantly - no other damage except that a macro in the personal file containing an 'onaction' statement failed on that line and even closed that file down. If you manually opened the file then debug launched at the problem line.

So decided to re-install Office which subsequently did but to little avail. Then searched the web for 'vba onaction fault' topics and came across pages that suggested that you could call functions and pass parameters ie
.onaction = "=DoAction()"

By calling the procedure as a function I have now resolved the problem but my question is still WHY?

Thanks for any suggestions

Ken
Feb 9 '11 #1
3 2159
TheSmileyCoder
2,322 Expert Mod 2GB
Try doing a decompile.

You this by going to Start->RUN and typing:
Expand|Select|Wrap|Line Numbers
  1. "C:\Program Files\Microsoft Office\OFFICE11\MSACCESS.EXE" /decompile
I think that for AC2007 you need to use OFFICE12 instead.

Now open your database while holding down SHIFT. Then open VBA editor window (ALT-F11) and press DEBUG->COMPILE.
Feb 9 '11 #2
Thanks SmileyOne

I neglected to say I am actually using VBA in excel but I reckon I would get the desired result if I substitute MSEXCEL for MSACCESS
Feb 9 '11 #3
TheSmileyCoder
2,322 Expert Mod 2GB
To be honest I don't really know. Access will allow code to be compiled when needed, and even at runtime, when you are in debug mode, you can change code (I STRONGLY ADVICE AGAINST IT!!!.) and access will do a partial compile.

While this can seem extremely handy, I have also on more then 1 occasion seen it cause corruption in access.

Therefore, when I get my error msg (Which of course NEVER happens :) ) I click the debug, to see the highlighted line, and then kill the process from the VBA window. Then I change my code, click Debug->compile, and try again. Changing code on the run is a great way to corrupt access, in my oppinion.

Now that was alot of ramble about access for an excel question. I really have no idea about whether excel does partial compiles as well, but I would imagine it to be so. Doing a decompile (and subsequent compile) can solve some of these problems, and have saved my *** once or twice.
Feb 9 '11 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: Fendi Baba | last post by:
The function is called from opencalendar(targetfield). Thanks for any hints on what could be the problem. .............................................................. var...
3
by: Robert | last post by:
---EN--- This message has been crossposted in a french speaking newsgroup, english version is at the end. Thanks a lot for your help... --/EN--- Bonjour, Je développe une application...
2
by: Karunakararao | last post by:
Hi All I'm using sybase database, I have a binary datatype column in a table, when I'm trying to store the char(128) value into that, I'm getting syntax violation error. If I take "w" as the...
3
by: Eagle | last post by:
First I tried using the try, catch, throw, but it errored on the throw and I don't want it to stop there, I want it to stop in the frm, not the class. Next I set a Session to catch the error, and...
25
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - Why does parseInt('09') give an error? ----------------------------------------------------------------------- ...
0
by: shil | last post by:
Hi all, updating SQL database with the data.I'm stuck with an issue. One of the XML file from the list don't have a node mentioned. For example almost all XML files structure is like this ...
5
by: Michael Bray | last post by:
I have some class files in App_Code (eg MyClass.cs) but if there is an error during compilation, the error list doesn't say what file the error is in. It just shows something like "(0,0): error...
1
by: psantosh12 | last post by:
Hello Frnds Please need help to resolve error.......... it is very very urgent........ The error is Runtime Error Description: An application error occurred on the server. The current custom...
2
by: Ushach | last post by:
hi all, how to resolve error " STATUS_INVALID_USER_BUFFER (c00000e8)"? thnx in advance
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.