Re: exit sub not working
- From: "Dave Allan via AccessMonster.com" <forum@xxxxxxxxxxxxxxxxx>
- Date: Sat, 30 Apr 2005 11:48:36 GMT
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
.
- Follow-Ups:
- Re: exit sub not working
- From: Dave Allan via AccessMonster.com
- Re: exit sub not working
- References:
- exit sub not working
- From: Ant
- Re: exit sub not working
- From: Dave Allan via AccessMonster.com
- Re: exit sub not working
- From: Ant
- exit sub not working
- Prev by Date: Re: VBE in Access 97
- Next by Date: Re: exit sub not working
- Previous by thread: Re: exit sub not working
- Next by thread: Re: exit sub not working
- Index(es):
Relevant Pages
|