Re: exit sub not working



hey Ant,

Sos about the wait. I see what you're doing and yes, very very messy, heh.
What you could do is specify the error number in your On.Error to match the
exact error you are explaining how to fix in:

MsgBox("You have a carrier " & Carr & " in the database and
not in the import file. Either add to the import file or delete from the
database", vbOKOnly)

as in if err.number = 2001 or whatever number is is, then msgbox(blah no
import file) etc

btw - you don't need "randvar = msgbox", just use msgbox on it's own.

In fact, the simplest thing to do is replace:

If Carr = "exit" Then GoTo Exit_Monthly_Click

with something along the lines of

if isnull(err) then exit sub

and totally loose the Exit_Monthly_Click:.

Rule of thumb, you really wanna avoid GoTo at any cost.

Why can't you fix this at source and take out the "stop all macros" thing
in the macro you are calling?

--
Message posted via http://www.accessmonster.com
.



Relevant Pages

  • Re: [PATCH 06/14] DRBD: userspace_interface
    ... help you fix a lot of codingstyle quirks that tend to annoy ordinary ... codingstyle encourages ALL_CAPS. ... Please use the existing dev_warn-style macros instead of writing ... +#undef M_ADDR ...
    (Linux-Kernel)
  • Re: Indentation all wrong!
    ... I used to just specify the indentation as you ... the final paragraph mark) into a new file, in order to get rid of any ... What is the best approach to fix this problem??? ...
    (microsoft.public.word.docmanagement)
  • Re: How do I make my own custom C compiler?
    ... to fix a bug. ... Macros everywhere hide from you what is going on. ... has been taken to ridiculous extremes (the assembler, ... For instance I am trying to understand the way gcc generates the ...
    (comp.lang.c)
  • Re: Cluebook Conundrum
    ... for Coca-Cola, I had him look at my office computer. ... I asked him if he could fix it. ... Heh ...
    (rec.games.computer.ultima.dragons)
  • Re: Office 2004 - Student and Teacher Edition - and Endnote 8.0
    ... though someone here told me how to fix it. ... When you reinstalled Office, did you do a default or custom install? ... Is it installed in your base applications folder (hard drive/apps) or in the ... I suspect Bookends also works by means of macros, ...
    (microsoft.public.mac.office.word)

Quantcast