Re: Closing user form in Initialize macro?
- From: "Bob Phillips" <bob.phillips@xxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 20 Apr 2005 00:06:40 +0100
Couple of ways, but both flash the form unfortunately.
1) If the conditions is met in Initialize, set a variable. Test the
variable in Activate event, and if set, unload the form
2) Good old Ontime. If the condition is met set a timed procedure
Application.OnTime Now + TimeSerial(0, 0, 1), "UnloadForm"
And in a standard code module, create a procedure called UnloadForm that
unloads the form.
--
HTH
RP
(remove nothere from the email address if mailing direct)
"Don Wiss" <donwiss@xxxxxxxxxxx> wrote in message
news:303b615hgu8s4svrhsuqco1a9op6jnro0a@xxxxxxxxxx
> I have a situation where the user form Initialize routine can fail to
> retrieve data from Access (which is used to populate a combo box). I now
> display a msgbox, but I then have to display the form, which of course is
> non-functional. I tried using Unload Me, but it didn't work. Presumably
> as the form wasn't yet loaded. I would think there must be a way to abort
> an initialization and not display the form.
>
> Don <www.donwiss.com> (e-mail link at home page bottom).
.
- References:
- Closing user form in Initialize macro?
- From: Don Wiss
- Closing user form in Initialize macro?
- Prev by Date: RE: Closing user form in Initialize macro?
- Next by Date: Re: Closing user form in Initialize macro?
- Previous by thread: RE: Closing user form in Initialize macro?
- Next by thread: Re: Closing user form in Initialize macro?
- Index(es):
Relevant Pages
|