[AccessD] OpenArggggggghhhhhhsssss

jwcolby jwcolby at colbyconsulting.com
Thu Aug 11 14:02:53 CDT 2011


 > OnOpen fires before OnLoad right?

According to the link that Artuhur posted, yes.  My whole life I have believed it was the other way 
around.  I pretty much avoid the OnLoad mostly because I have done things that needed to be able to 
cancel the form even opening.  The cancel doesn't exist in OnLoad.

John W. Colby
www.ColbyConsulting.com

On 8/11/2011 2:22 PM, William Benson (VBACreations.Com) wrote:
> I can do that John.
>
>
> By the way, this is sorta related ... when conrols have a rowsource -- or
> maybe a controlsource, not sure -- that is no longer valid because it
> doesn't exist... Access will often give an annoying message. I am not saying
> an inappropriate message, just an annoying one. Even though I sometimes do
> things in the Open event to fix the problem. Is there ANYTHING short of
> pre-opening a form in design view, testing object rowsources and
> controlsources for validity, and fixing "offline", before opening the form
> -- that will be the right time to make these tweaks and fixes?
>
>
>
> -----Original Message-----
> From: accessd-bounces at databaseadvisors.com
> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby
> Sent: Thursday, August 11, 2011 1:17 PM
> To: Access Developers discussion and problem solving
> Subject: Re: [AccessD] OpenArggggggghhhhhhsssss
>
> Try moving the string assignment to OnOpen.  OnLoad is the point when eh
> form loads and is really
> before anything much is happening on the form.
>
> John W. Colby
> www.ColbyConsulting.com
>
> On 8/11/2011 12:32 PM, William Benson (VBACreations.Com) wrote:
>>
>> I am sending a nonempty string to openargs but when the form is closing I
>> call a subprocedure on the form which is closing -- and when that
> procedure
>> refers to OpenArgs, it is frequently null for reasons which I cannot
>> understand....? So I tried assigning the openargs to a module level string
>> variable instead, on _Load. I saw that the OpenArgs was null in that
>> assignment statement, throwing an error. So I checked the call stack, went
>> to the line of code which was opening the form, and saw that it was fine -
>> the strOpenArgs variable I was passing as the value for the OpenArgs
>> argument was a populated string. Anyone seen this?
>>
>> My workaround is to give up on OpenArgs and resort to a global string
>> variable.
>>
>> Thanks
>>



More information about the AccessD mailing list