[AccessD] Find First in an Array? - The Solution

Stuart McLachlan stuart at lexacorp.com.pg
Mon Feb 23 17:21:12 CST 2009


I've played around with Max's solution a bit.

Here is the *total* code required (apart from Max's existing code to  update Tags which is 
only run when changes are made to the languages table)

A single line  inserted in each Form's on_open event:
GetLanguageCaptions Me

A simple seven line function placed somewhere in a standard module (actually five lines if 
you make it a single line If...... statement):  

Public Function GetLanguageCaptions(frm As Form)
  Dim ctl As Control, lng As Long
  lng = DLookup("ChosenLanguage", "tblSysInfo") - 1
  For Each ctl In frm.Controls
    If ctl.ControlType = acLabel And Len(ctl.Tag) > 1 Then
      ctl.Caption = Split(ctl.Tag, "+")(lng)
    End If
  Next ctl
End Function

That's all folks!

Cheers,
Stuart






On 23 Feb 2009 at 19:57, Max Wanadoo wrote:

> This one max.wanadoo at gmail.com
> Can you also include 1xform any one will do, but the "busier" the better, ie
> as many controls as possible that need the language converting.  If that is
> too much work, then don't bother.
> 
> See what people do for you - popular or what?
> 
> Max
> Laugh more than cry.  Smile more than frown.  Be generous in  spirit.  And
> always stand your round in the pub!
> 
> 
> -----Original Message-----
> From: accessd-bounces at databaseadvisors.com
> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin at
> Beach Access Software
> Sent: 23 February 2009 14:10
> To: 'Access Developers discussion and problem solving'
> Subject: Re: [AccessD] Find First in an Array? - The Solution
> 
> What's the best email address? 
> 
> 
> Rocky Smolin
> Beach Access Software
> 858-259-4334
> www.e-z-mrp.com
> www.bchacc.com
>  
>  
> 
> -----Original Message-----
> From: accessd-bounces at databaseadvisors.com
> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Max Wanadoo
> Sent: Monday, February 23, 2009 6:05 AM
> To: 'Access Developers discussion and problem solving'
> Subject: Re: [AccessD] Find First in an Array? - The Solution
> 
> Me too Rocky,
> 
> 
> Max
> Laugh more than cry.  Smile more than frown.  Be generous in  spirit.  And
> always stand your round in the pub!
> 
> 
> -----Original Message-----
> From: accessd-bounces at databaseadvisors.com
> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin at
> Beach Access Software
> Sent: 23 February 2009 13:54
> To: 'Access Developers discussion and problem solving'
> Subject: Re: [AccessD] Find First in an Array? - The Solution
> 
> I can do that.  What's the best address? 
> 
> 
> Rocky Smolin
> Beach Access Software
> 858-259-4334
> www.e-z-mrp.com
> www.bchacc.com
>  
>  
> 
> -----Original Message-----
> From: accessd-bounces at databaseadvisors.com
> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Jim Dettman
> Sent: Monday, February 23, 2009 5:50 AM
> To: 'Access Developers discussion and problem solving'
> Subject: Re: [AccessD] Find First in an Array? - The Solution
> 
> 
>   
> If someone can send me the language tables off list, I'll take the time to
> do the seek approach just for the heck of it and then we really can do an
> apples to apples comparison.
> 
> Jim. 
> 
> -----Original Message-----
> From: accessd-bounces at databaseadvisors.com
> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of William Hindman
> Sent: Sunday, February 22, 2009 5:44 PM
> To: Access Developers discussion and problem solving
> Subject: Re: [AccessD] Find First in an Array? - The Solution
> 
> ...can't speak for Rocky but I've got three good solutions and two sample
> mdbs, all of which work ...hard to beat that!
> ...thanks all :)
> 
> William
> 
> --------------------------------------------------
> From: "Max Wanadoo" <max.wanadoo at gmail.com>
> Sent: Sunday, February 22, 2009 5:25 PM
> To: "'Access Developers discussion and problem solving'" 
> <accessd at databaseadvisors.com>
> Subject: Re: [AccessD] Find First in an Array? - The Solution
> 
> > Rocky,
> >
> > My last direct posting to you via the mdb addresses all the concerns 
> > in your last three posting which have just hit my in-box.
> > It does use the caption.tag to store the language strings but when I 
> > get some time I will see about appending a user.property to the form.
> > I think that is doable so you don't need to have to use the .tag.
> >
> > But anyway, the last version allows for instant swapping between 
> > languages in a flash.  No need to create different versions for 
> > different language clients.  One version now fits all.  It also has 
> > code to create all the language strings from the language table - you 
> > don't have to type any thing in - just run the code.
> >
> > I would also recommend the options from John, Stuart etc which all 
> > have advantages.
> >
> > Have a look.  Sorry about the diminishing market but in the UK I think 
> > it is starting to pick up again so hopefully that will happen in the 
> > US.
> >
> > Take care.
> >
> > Max
> > Laugh more than cry.  Smile more than frown.  Be generous in  spirit.  
> > And always stand your round in the pub!
> >
> >
> >
> > -----Original Message-----
> > From: accessd-bounces at databaseadvisors.com
> > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky 
> > Smolin at Beach Access Software
> > Sent: 22 February 2009 22:08
> > To: 'Access Developers discussion and problem solving'
> > Subject: Re: [AccessD] Find First in an Array? - The Solution
> >
> > I'm flexible.  I'm bending over for these people right now.
> >
> >
> > Rocky Smolin
> > Beach Access Software
> > 858-259-4334
> > www.e-z-mrp.com
> > www.bchacc.com
> >
> >
> >
> > -----Original Message-----
> > From: accessd-bounces at databaseadvisors.com
> > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Max Wanadoo
> > Sent: Sunday, February 22, 2009 2:30 AM
> > To: 'Access Developers discussion and problem solving'
> > Subject: Re: [AccessD] Find First in an Array? - The Solution
> >
> > Further to my last posting, Rocky.
> >
> > I suppose you could also give the evaluators the one you currently 
> > have where the form get updated each time based on the language 
> > selected and tell the potential clients that a language specific 
> > option is available with improved form rendering.  Then when the order 
> > (as they will surely do) give them the translated mde copy, 
> > Flexibility is the keyword here, I think.
> >
> > Max
> > Laugh more than cry.  Smile more than frown.  Be generous in  spirit.  
> > And always stand your round in the pub!
> >
> >
> >
> > -----Original Message-----
> > From: accessd-bounces at databaseadvisors.com
> > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky 
> > Smolin at Beach Access Software
> > Sent: 22 February 2009 08:47
> > To: 'Access Developers discussion and problem solving'
> > Subject: Re: [AccessD] Find First in an Array? - The Solution
> >
> > Another complication - evaluators can be requested from the web site.  
> > I suppose I could ask for the language as part of the request.  I'd 
> > have to allow them to ask for multiple copies - different languages in 
> > case French speaking management wanted to evaluate it as well as the 
> > Chinese workers in the factory.  IOW, the customer may not know for 
> > sure which language they want.
> >
> > Plus I'd have to maintain currently 5 versions of the program - one 
> > for each language.
> >
> >
> > Rocky Smolin
> > Beach Access Software
> > 858-259-4334
> > www.e-z-mrp.com
> > www.bchacc.com
> >
> >
> >
> > -----Original Message-----
> > From: accessd-bounces at databaseadvisors.com
> > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Max Wanadoo
> > Sent: Saturday, February 21, 2009 5:12 PM
> > To: 'Access Developers discussion and problem solving'
> > Subject: Re: [AccessD] Find First in an Array? - The Solution
> >
> > Hi Gustav,
> > Pub is now dry.. came home...ha!
> > Well, if you are sending an MDE you would run the Translation Program 
> > then convert to an .MDE and then send it to client and then go back to 
> > pub - eh?
> > Max
> >
> >
> > -----Original Message-----
> > From: accessd-bounces at databaseadvisors.com
> > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav 
> > Brock
> > Sent: 21 February 2009 23:14
> > To: accessd at databaseadvisors.com
> > Subject: Re: [AccessD] Find First in an Array? - The Solution
> >
> > Hi Max and Rocky
> >
> > OK, that minor reason turned into a major; you will perform design 
> > changes of the forms which isn't possible in an mde.
> >
> > /gustav
> >
> >>>> Gustav at cactus.dk 21-02-2009 16:10 >>>
> > Hi Max
> >
> > Very good! You have point here.
> > It's a bit like Drew's suggestion but with a clever twist which I will 
> > leave for others to figure out (I have seen the sample db from Max).
> >
> > I can, however, think of one minor reason to not use your approach.
> >
> > Who said you don't get bright ideas while sleeping?
> >
> > /gustav
> >
> >>>> max.wanadoo at gmail.com 21-02-2009 13:47 >>>
> > Hello Rocky,
> > Well, I have read with interest all the to-ing and fro-ing from the 
> > various contributors.
> > So, I laid me down laterally and started thinking laterally.
> > The solution came to be sometime around my 3rd drink.
> > I consolidated my thoughts in bed.
> > When I woke this morning, I tested them out with a sample mdb using 
> > English, French and German.  All work beautifully.  Add as many 
> > languages as you want.
> >
> > The solution I have has the following benefits:
> >
> > Instantaneous
> > No variables
> > No Collections
> > No Classes (although the solution could be said to be upper class 
> > <ha!> No Arrays No Memory overheads Forms shown the language required 
> > every time with no overheads.
> > Unlimited Languages
> >
> > Should I post the sample mdb to you?
> >
> > Max
> > Ps. Bet your intrigued - you will love this solution.
> >
> >
> >
> > --
> > AccessD mailing list
> > AccessD at databaseadvisors.com
> > http://databaseadvisors.com/mailman/listinfo/accessd
> > Website: http://www.databaseadvisors.com
> >
> > --
> > AccessD mailing list
> > AccessD at databaseadvisors.com
> > http://databaseadvisors.com/mailman/listinfo/accessd
> > Website: http://www.databaseadvisors.com
> >
> > --
> > AccessD mailing list
> > AccessD at databaseadvisors.com
> > http://databaseadvisors.com/mailman/listinfo/accessd
> > Website: http://www.databaseadvisors.com
> >
> > --
> > AccessD mailing list
> > AccessD at databaseadvisors.com
> > http://databaseadvisors.com/mailman/listinfo/accessd
> > Website: http://www.databaseadvisors.com
> >
> > --
> > AccessD mailing list
> > AccessD at databaseadvisors.com
> > http://databaseadvisors.com/mailman/listinfo/accessd
> > Website: http://www.databaseadvisors.com
> >
> > --
> > AccessD mailing list
> > AccessD at databaseadvisors.com
> > http://databaseadvisors.com/mailman/listinfo/accessd
> > Website: http://www.databaseadvisors.com
> > 
> 
> -- 
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
> 
> -- 
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
> 
> -- 
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
> 
> -- 
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
> 
> -- 
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
> 
> -- 
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com





More information about the AccessD mailing list