Re: Goes to Error Label even though err.number = 0
- From: "Allen Browne" <AllenBrowne@xxxxxxxxxxxxxx>
- Date: Sat, 6 Jan 2007 09:58:27 +0900
Okay, if you are *certain* there is no way the logic could jump into the error handler of the procedure without an error, and that nothing else could be clearing the error, then I have to assume there is a corruption in the VBA. A decompile might fix it. Try this sequence (in order):
1. Uncheck the boxes under:
Tools | Options | General | Name AutoCorrect
Explanation of why:
http://allenbrowne.com/bug-03.html
2. Compact the database to get rid of this junk:
Tools | Database Utilities | Compact/Repair
3. Close Access. Make a backup copy of the file. Decompile the database by entering something like this at the command prompt while Access is not running. It is all one line, and include the quotes:
"c:\Program Files\Microsoft office\office\msaccess.exe" /decompile
"c:\MyPath\MyDatabase.mdb"
4. Open Access (holding down the Shift key if you have any startup code), and compact again.
5. Open a code window.
Choose References from the Tools menu.
Uncheck any references you do not need.
For a list of the ones you typically need in your version of Access, see:
http://allenbrowne.com/ser-38.html
6. Still in the code window, choose Compile from the Debug menu.
Fix any errors, and repeat until it compiles okay.
At this point, you should have a database where the name-autocorrect errors are gone, the indexes are repaired, inconsistencies between the text- and compiled-versions of the code are fixed, reference ambiguities are resolved, and the code syntax is compilable.
If it is still a problem, the next step would be to get Access to rebuild the database for you. Follow the steps for the first symptom in this article:
Recovering from Corruption
at:
http://allenbrowne.com/ser-47.html
--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
"Brian Watson" <BrianWatson@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:C42D6E2A-8791-45DC-BA76-8CE34FC6CC0B@xxxxxxxxxxxxxxxx
Thanks for replying but I'm a very experienced programmer and would have
spotted such a mistake. No this is coded correctly but Access behaves in an
unpridictable manner.
"Allen Browne" wrote:
Error 0 usually means you forgot to include the:
Exit Sub
or
Exit Function
above the error handler.
As a result, the routine runs without error, but continues down into the
error handler.
"Brian Watson" <BrianWatson@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:118FBA89-8A22-4417-81F4-9DEBC1B4668A@xxxxxxxxxxxxxxxx
>I have a form (job) with a subform (items) the items have a size the job
>has
> an area. A command button runs a routine that calculate the quantity of
> items
> requied to cover the area. During the caluculation the quantity of each
> item
> on the form is updated. At the end of the caluculation the job form is
> updated with summary values. At the point of updating a job form field > the
> program jumps to the on error label set at the start of the routine > with
> an
> Err.Number = 0. Has anybody any ideas why? Is this something anybody > has
> ever
> experienced? Your comments would be gratfully received. If at the error
> label
> I resume the statement is executed without complaint and the routine
> completes. Unfortunately the next time the button is clicked the Access
> hangs.
.
- References:
- Re: Goes to Error Label even though err.number = 0
- From: Allen Browne
- Re: Goes to Error Label even though err.number = 0
- Prev by Date: Inserting records into junction table (and subform) from popup form
- Next by Date: Re: AlphaNumeric IDs
- Previous by thread: Re: Goes to Error Label even though err.number = 0
- Next by thread: Searching for a record based on a text box value
- Index(es):
Relevant Pages
|