Max Wanadoo
max.wanadoo at gmail.com
Thu Feb 19 01:52:14 CST 2009
Yeah, I know. Could get out of hand and un-maintainable very quickly. Ok, I'm back to the lateral thinking position ^-^ Max -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin at Beach Access Software Sent: 19 February 2009 00:17 To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Find First in an Array? Max: That would work except the table driven approach is so much more easier. Easy to add a language (got French and Spanish now in addition to traditional and simplified Chinese), too, or make a change to a translation. To add a language I just add a column for that language to the Control and Messages tables and send them to the translator. Add that language to the language selector combo on the Preferences form, and walla! Another 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: Wednesday, February 18, 2009 4:04 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Find First in an Array? Hey Rocky - something lateral again. If you group select the labels for the controls and copy-paste them then drag them down clear of the originals for the moment. Then group select the original labels and set the Tag to "English" - one entry sets all. Then group select the copied labels and set the Tag to "German" - again one entry sets all Then for each of the German Labels, write the words you want to display in German. Then drag the German Group up over the English Group so that they site exactly on top. Then group select the data control (ie, the text box) and in the Tag put "English-German" - this will match any of the languages. Then in the form.onLoad event put this code Option Compare Database Option Explicit 'Const conLanguage = "German" Const conLanguage = "English" ' these could be a system parameter instead of a constant = this is only for illustrating. Private Sub Form_Load() Dim ctl As Control For Each ctl In Me.Controls Debug.Print ctl.Name, ctl.Tag, InStr(ctl.Tag, conLanguage) > 0 - for testing ctl.Visible = InStr(ctl.Tag, conLanguage) > 0 Next ctl End Sub Swapping the conlanguage constant around will display only the labels that match the language but the data control matches both. On they form I just knocked up it was instantaneous. Repeat for Spanish, Canadian, etc. Lots of Labels (but only 1 set of data controls) - it is only the lables you need to change, right? Something different anyway! Max Ps. I have never done this before so I do not know if it is robust in a working environment, but should be. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin at Beach Access Software Sent: 18 February 2009 22:57 To: 'Access Developers discussion and problem solving' Subject: [AccessD] Find First in an Array? Dear List: I have an app set up for multiple languages. The translations are pulled from a table at the time the form or report is opened by cycling through the controls (labels and button captions) and getting the appropriate translation. To make the thing run faster (there's a noticeable translation delay), I'm thinking of loading these translations into an array in memory and fetching the translation from the array. However, AFAIK, there's no equivalent to a FindFirst in an array like there is in a recordset. So, is there a better way to find the right translation in the array short of going through the array in sequence for each item to be translated? MTIA for any ideas, 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/> -- 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