Re: object variable or with block variable not set

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Adam Ulrich \(MS\) (adamu_at_online.microsoft.com)
Date: 07/22/04


Date: Thu, 22 Jul 2004 15:06:54 -0700

Yes, I have a pretty good idea. Form_close is not equivalent to Form_unload.
In your case, something else is holding onto the form as a reference, and it
is being closed, but not unloaded from memory. Maybe other forms? You can
confirm this by putting a break point in the form_load and form_close
methods. I bet you hit the form_load and form_close the first time, but any
subsequent times the form is displayed and the form_load is not fired, but
closing the form causes the form_close to fire, and your objects have not
been declared this time because form_load never fired. To fix this, try
moving the code from form_load into form_activate. regardless of the forms
load status, activate should always fire.

Regards,

Adam

"Tony" <anonymous@discussions.microsoft.com> wrote in message
news:20d701c46ffb$73899f50$a401280a@phx.gbl...
> It doesn't happen the first time that I close the
> form...it's like the .dll needs to be re-registered or
> something...but once I get it once, I get it every time I
> close a form that has the procedure. Have an idea, Adam?
> Thanks, Tony
>
>>-----Original Message-----
>>Tony, I am interested to know if it happens every time
> you close the
>>specific form or if it happens only part of the time you
> close the form.
>>
>>-Adam
>>
>>
>>"Stephen Lebans" <ForEmailGotoMy.WebSite.-
> WWWdotlebansdotcom@linvalid.com>
>>wrote in message news:%
> 23mDlsO2bEHA.2944@TK2MSFTNGP11.phx.gbl...
>>> Tony the MouseHook DLL is in use by 1000's of people. I
> cannot duplicate
>>> the behaviour you describe nor has anyone ever emailed
> or posted the
>>> issue you are describing.
>>> As I replied to your Email today, my question remains,
> are you able to
>>> get the sample form to work properly?
>>> --
>>>
>>> HTH
>>> Stephen Lebans
>>> http://www.lebans.com
>>> Access Code, Tips and Tricks
>>> Please respond only to the newsgroups so everyone can
> benefit.
>>>
>>>
>>> "Tony" <anonymous@discussions.microsoft.com> wrote in
> message
>>> news:12eb01c46f20$dff9c060$a401280a@phx.gbl...
>>>> Actually, that only works if the focus is in one the
>>>> controls that hold data. Then the mouse wheel doesn't
>>>> work. If a command button has the focus, the mouse
> wheel
>>>> allows users to scroll through records.
>>>>
>>>> >-----Original Message-----
>>>> >Sorry: no idea, other than perhaps you made a mistake
> in
>>>> creating the DLL.
>>>> >
>>>> >To get around this, check out what Stephen Lebans has
> at
>>>> >http://www.lebans.com/mousewheelonoff.htm It's a far
>>>> better solution than
>>>> >that KB article anyhow.
>>>> >
>>>> >--
>>>> >Doug Steele, Microsoft Access MVP
>>>> >http://I.Am/DougSteele
>>>> >(no e-mails, please!)
>>>> >
>>>> >
>>>> >
>>>> >"Tony" <anonymous@discussions.microsoft.com> wrote in
>>>> message
>>>> >news:08ad01c46e5f$a3ea3440$a301280a@phx.gbl...
>>>> >> Morning, Doug, no, no errors before it happens.
> Tony
>>>> >>
>>>> >> >-----Original Message-----
>>>> >> >Do you normally encounter an error, and afterwards
> the
>>>> >> problem arises?
>>>> >> >
>>>> >> >--
>>>> >> >Doug Steele, Microsoft Access MVP
>>>> >> >http://I.Am/DougSteele
>>>> >> >(no e-mails, please!)
>>>> >> >
>>>> >> >
>>>> >> >
>>>> >> >"Tony" <anonymous@discussions.microsoft.com> wrote
> in
>>>> >> message
>>>> >> >news:2f8b701c46d89$9aad1cc0$a401280a@phx.gbl...
>>>> >> >> Doug, thank you for answering. It happens
>>>> sporadically
>>>> >> >> and only on one form. Tony
>>>> >> >>
>>>> >> >> >-----Original Message-----
>>>> >> >> >It sounds as though something is causing
>>>> clsMouseWheel
>>>> >> >> to become
>>>> >> >> >uninstantiated during the execution. Does this
>>>> happen
>>>> >> >> every time, or only
>>>> >> >> >when an error occurs when using the form.
>>>> >> >> >
>>>> >> >> >--
>>>> >> >> >Doug Steele, Microsoft Access MVP
>>>> >> >> >http://I.Am/DougSteele
>>>> >> >> >(no e-mails, please!)
>>>> >> >> >
>>>> >> >> >
>>>> >> >> >
>>>> >> >> >"Tony" <anonymous@discussions.microsoft.com>
> wrote
>>>> in
>>>> >> >> message
>>>> >> >> >news:2ee3901c46b67$3e8df230$a301280a@phx.gbl...
>>>> >> >> >> Hello, everybody...I found an article on MS
>>>> website
>>>> >> on
>>>> >> >> how
>>>> >> >> >> to prevent the Mouse Wheel from scrolling
> through
>>>> >> >> records
>>>> >> >> >> in a MS Access DB
>>>> >> (support.microsoft.com/defalut.aspx?
>>>> >> >> >> scid=kb;en-us;278379). On the form Load
> event I
>>>> >> have:
>>>> >> >> >> Set clsMouseWheel = New
> MouseWheel.CMouseWheel
>>>> >> >> >> Set clsMouseWheel.Form = Me
>>>> >> >> >> clsMouseWheel.SubClassHookForm
>>>> >> >> >> and on the form's Close event I have:
>>>> >> >> >> clsMouseWheel.SubClassUnHookForm
>>>> >> >> >> Set clsMouseWheel.Form = Nothing
>>>> >> >> >> Set clsMouseWheel = Nothing
>>>> >> >> >> When I close the form, I receive a "Run-time
>>>> >> Error '91':
>>>> >> >> >> object variable or With block variable not
>>>> >> set"...Does
>>>> >> >> >> anyone know a fix to this? I can't find
> where the
>>>> >> >> problem
>>>> >> >> >> might be. Thanks, Tony
>>>> >> >> >
>>>> >> >> >
>>>> >> >> >.
>>>> >> >> >
>>>> >> >
>>>> >> >
>>>> >> >.
>>>> >> >
>>>> >
>>>> >
>>>> >.
>>>> >
>>>
>>
>>
>>.
>>



Relevant Pages

  • Re: Brian and the farm (now psoirel Thursday)
    ... But what he's telling Jenny is not what he suggested to Tony. ... He seems to have told her that "all four of them" (presumably Debbie, Adam, Kate and Alice) would get the farm, but no mention of Rhubarb. ... I think devious here: because he was talking about the digester project and handing *that* over to the four of them: not the Rhubarb question. ...
    (uk.media.radio.archers)
  • Ultimate history book
    ... I went to the launch party last night for "Ultimate: ... Who knew that Adam ran in such high-profile circles. ... Tough to hear Adam and Tony during their "readings," but that's not ... Loads and loads of great pics, ...
    (rec.sport.disc)
  • Re: Home Sweet Home from notWigan
    ... new "Baptism of Fire" manglement Steve and Dave, Tony ...
    (uk.music.guitar)
  • Re: Word 2003 default font setting wont hold
    ... If you have Acrobat 7 ... installed, that will be the reason, see ... Tony ... > When I fire up the computer each day, the default font that I've chosen ...
    (microsoft.public.word.docmanagement)
  • Re: Kyle Busch = dumb@**
    ... I thought it was great - loved to see some temper, regardless of whose ... LOL. ... The only thing better would have been if Tony had ...
    (rec.autos.sport.nascar)