stopping a macro based on a conditional

C

Craig

Maybe it's just been a long day, but I can't remember how I've done
this in the past. I'm trying to have a macro stop based on a
condition. It's coming from a form, but if things are done out of
order in one spot, things go bad, so I'm trying to force the user into
selecting a Week Beginning Date prior to checking a box. The week
beginning date loads down to [Data!b2] so this macro is checking to see
if there's anything there, if there is, it follows the code from there,
if that cell is blank though, I want it to pop up a message, then
return to the form (preferably without unloading and reloading the form
as the user will lose all of their entries to that point). Any ideas?
Here's what I've in this section now,

If MultipleBox = True Then
If [data!b2].Value = "" Then
MsgBox "Choose Initial Request Week First"
MultipleBox = False
End Sub
End If
'From here the remainder of the code goes . . .


Now I'm sure it's not end sub, but i can't remember what goes there -
i've tried stop (does nothing) and end function (gives an error, then
does nothing). Basically all i'm looking for is this, when the box is
checked (this is in the MultipleBox_AfterUpdate) if it's true, check to
see that the week beginning date has been selected, if that cell is
blank - pop up a message - set the box back to unchecked - stop this
macro while leaving the form running. Can someone point me back in the
right direction?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top