Max Wanadoo
max.wanadoo at gmail.com
Wed Feb 25 02:03:28 CST 2009
Yes, agree on both accounts. I had problems getting split() to work in A2k7 but I cut=n=pasted Stuarts example and that works ok, so it must have been me! I also agree about the delimiter. I would normally use the pipe "|" but I wanted to make it visible in the EXAMPLE I was posting to Rocky. It could then be changed when all the code was tightened up following these and other suggestions from the List. We are doing well so far, great responses and tons of different ways of looking at the same problem. Hover, I *think* the "best" all round answer in my opinion will be the Classes regardless of the "cleverness" of direct text storage, but I have one or two other alternatives which I will throw at the List for comments etc. A good learning curve for me. Won't get a lot of time on here until the Weekend though. 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 Drew Wutka Sent: 25 February 2009 00:18 To: Access Developers discussion and problem solving Subject: [AccessD] Max's Tag solution First of all, GREAT JOB Max. Two comments for you. 1. In your 'sGetLanguageCaptions' code, you can simplify your code by using Split, instead of searching through the string: Private Sub sGetLanguageCaptions() ' set the caption based on the language selected where language value is held in glngLangauge variable Dim ctl As Control, strCaption As String, lng As Long, str As String Dim strArray() As String For Each ctl In Me.Controls If ctl.ControlType = acLabel And Len(ctl.Tag) > 1 Then strArray = Split(ctl.Tag, "+") ctl.Caption = strArray(glngLanguage - 1) End If Next ctl End Sub 2. The delimiter should be a non-typable character. You never know when a typable character will be used in a caption. In your sample, you used the plus sign. If a caption read: 'Credits+Debits' it would add another 'element' to what you have stored in the tag. Since some foreign languages require Unicode, it would probably be better to 'create' a delimiter, instead of using something like chr(240). Something like '|$@' two or three characters that would be garbage. Split can use multiple character delimiters. Drew The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com