[AccessD] JC's Solution

jwcolby jwcolby at colbyconsulting.com
Sun Feb 22 18:42:21 CST 2009


Rocky,

I tried to use the load event and it did not fire.  I am not sure why.  I will go back and try again.

Such code belongs... in the clsXlateFrm.  One huge purpose of classes is to organize your code such 
that the code that belongs with an object is all in a container for that object.

I do understand your reluctance to use a system that uses classes if you do not understand classes. 
  OTOH, these two classes are so trivial that I can walk you through them.  In fact I will walk 
AccessD through them.

I gave you a form to use to select a language and a form to open.  The code to open the form is a 
single line.  I will post the code in three lectures, as I have in the past, then step by step walk 
you through the code so that you can understand how and why it works.

One of the things I noticed in my own applications is that if there are toolbars in design view, 
then often the form opens, displays the toolbars, then makes those disappear, then redraws the form 
making the form full screen.  The resize event actually fires each time that happens.  By getting 
rid of the toolbars in design view (in my app), the form opens full size and does not go through 
that intermediate resize stuff.  Flashing gone.

Completely silly that should happen but it did.

Also you should call Maximize FIRST!  Do not draw the screen then maximize the screen.  Even if it 
is hidden, it will slow down the form opening.

John W. Colby
www.ColbyConsulting.com


Rocky Smolin at Beach Access Software wrote:
> John:
>  
> I reviewed the code and I think I see how it works, but not entirely.  I'll
> be back with more questions I'm sure.  But,as I said, I have to go back to
> the beginning of the Class class and start from there.  Until I can
> understand completely what's going on I'm reluctant to put it into the
> product since it makes maintenance much more difficult. But it's going to be
> good for learning.  BTW, if you want to include this in your eBook, feel
> free.  Send me a permission form.  I'd be honored to be included.  I wonder
> if Apress would be interested?
>  
> I did see a flash or repaint when opening one of my translated forms in
> TranslateJWC20080221.mdb.  Do you know what that might be due to?  It's
> really minimal especially compared to what I was seeing in my app before,
> and even less than the latest version in which I went through and put the
> following 5 lines in each form:
>  
>     Application.Echo False
>     Call adhScaleForm(Me, 640, 480, 96, 96, rctOriginal)
>     Call TranslateControlForm(Me.Name)
>     DoCmd.Maximize
>     Application.Echo True
> 
> Before the calls to Scale, Translate, and Maximize were in random orders.
> This sequence seemed to work best to minimize the flashing before I put the
> Echo statements in - even less after, but not zero.  It was the flashing
> that was the problem  was really trying to solve.  And I was thinking that
> the translation routine might be causing some of it, especially the Chinese
> which seems to take more resources to display.  Or something.
>  
> Anyway, that leads to another question - the answer to which will hopefully
> be useful to someone besides me - would that code - the five lines - be
> better in the Open event or the Load event?  Any guidelines on when to use
> one vs. the other?
>  
> Thanks again for your help and for creating all that material for the list.
> You're holding my marker.
>  
> 
> Rocky Smolin
> 
> Beach Access Software
> 
> 858-259-4334
> 
> www.e-z-mrp.com <http://www.e-z-mrp.com/> 
> 
> www.bchacc.com <http://www.bchacc.com/> 
> 
>  
> 
>  
> 
>  



More information about the AccessD mailing list