Re: Closing user form in Initialize macro?

Tech-Archive recommends: Fix windows errors by optimizing your registry



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).


.



Relevant Pages

  • Re: Closing user form in Initialize macro?
    ... you can unload in there. ... Dim f As frmData ... >I have a situation where the user form Initialize routine can fail to ... > display a msgbox, but I then have to display the form, which of course is ...
    (microsoft.public.excel.programming)
  • Re: JavaScript on Demand
    ... - The problem is it does not initialize the TXT even though it is ... tinyMCE initializes some functionality, so I see the editor appended ... to my textarea field. ... user can select what content to display. ...
    (comp.lang.javascript)
  • Re: pic16f77 acting goofy
    ... consider myself an expert (competent? ... Now that I look back over my program I can see that I don't initialize ... rewritten anyway before being used to send data to the display. ... Since I only have 20 buttons, the only possibilities for dig1a is ...
    (comp.arch.embedded)
  • Re: Apple Memory on Power-up?
    ... So THATS why every time I booted up Aztec and chose level 1, it always created the same level configuration for the first game. ... The string that would appear at the bottom of the screen would be @VWKHEY Of course that was only on the pure Apple-built II+ that we had, we had another clone hand-built that would display some different string and would make a different level config but it was still always the same on first boot up. ... to initialize but fails due to a bug) is not initialize in the last ...
    (comp.emulators.apple2)
  • Re: Varchar type column with null value has a when unloaded
    ... I will bet you do not have a varchar type column in one of your tables ... with null value that will display a blank value from a select ... You can also select and unload "WHERE varchar_col IS NULL", of course, ... Kansas City Informix Users Group ...
    (comp.databases.informix)