[AccessD] Iterating Thorugh Controls

Rocky Smolin - Beach Access Software bchacc at san.rr.com
Sun Jun 13 08:29:45 CDT 2004


Erwin:

I do something similar.  But in the case of a control with a tab form
instead of passing Me.Name for the form name I tried passing the object (Me)
to another flavor of the translate routine where the argument is defined AS
Object instead of AS Form.  For some reason I don't understand it now
iterates all of the control except the sub-form.  But the sub-form has its
own Form_Open event where I can call the translation function.

Regards,

Rocky Smolin
Beach Access Software
http://www.e-z-mrp.com


----- Original Message ----- 
From: "Erwin Craps - IT Helps" <Erwin.Craps at ithelps.be>
To: "Access Developers discussion and problem solving"
<accessd at databaseadvisors.com>
Sent: Saturday, June 12, 2004 3:05 PM
Subject: RE: [AccessD] Iterating Thorugh Controls


>
> Hi Rocky
>
> I use this code to make my form in multiple user languages.
> Id do iterate trough tabs but not subforms.
> A subform, in my case, runs this procedure also when loading...
> Look in the code for the case "tabstrip"
>
> Greetz
> Erwin
>
>
> For Each ctl In varFrm.Controls
>         'Set ctl.Font = fnt
>
>         strSCtlType = TypeName(ctl)
>         Select Case strSCtlType
>             Case "Label"
>                 ctl.Caption = LoadResString(CLng(ctl.Tag), ,
> varLanguage_Lid)
>                 ctl.ControlTipText =
> LoadResString(CLng(ctl.ControlTipText), , varLanguage_Lid)
>
>             Case "Menu"
>                 ctl.Caption = LoadResString(CLng(ctl.Caption), ,
> varLanguage_Lid)
>
>             Case "TabStrip"
>                 For Each obj In ctl.Tabs
>                     obj.Caption = LoadResString(CLng(obj.Tag), ,
> varLanguage_Lid)
>                     obj.Tooltiptext =
> LoadResString(CLng(obj.Tooltiptext), , varLanguage_Lid)
>                     obj.StatusBarText =
> LoadResString(CLng(obj.StatusBarText), , varLanguage_Lid)
>                 Next
>
>             Case "Toolbar"
>                 For Each obj In ctl.Buttons
>                     obj.Tooltiptext =
> LoadResString(CLng(obj.Tooltiptext), , varLanguage_Lid)
>                 Next
>
>             Case "ListView"
>                 For Each obj In ctl.ColumnHeaders
>                     obj.text = LoadResString(CLng(obj.Tag), ,
> varLanguage_Lid)
>                 Next
>
>             Case Else
>                 lngNVal = Val(ctl.Tag)
>                 If lngNVal > 0 Then
>                     ctl.Caption = LoadResString(lngNVal, ,
> varLanguage_Lid)
>                 End If
>                 lngNVal = 0
>                 lngNVal = Val(ctl.Tooltiptext)
>                 If lngNVal > 0 Then
>                     ctl.Tooltiptext = LoadResString(lngNVal, ,
> varLanguage_Lid)
>                 End If
>                 lngNVal = Val(ctl.ControlTipText)
>                 If lngNVal > 0 Then
>                     ctl.ControlTipText = LoadResString(lngNVal, ,
> varLanguage_Lid)
>                 End If
>                 lngNVal = Val(ctl.StatusBarText)
>                 If lngNVal > 0 Then
>                     ctl.StatusBarText = LoadResString(lngNVal, ,
> varLanguage_Lid)
>                 End If
>         End Select
>
>         'Check for unfilled tags  or missing in resource
>         ctl.Caption = LoadResString(CLng(ctl.Tag), , varLanguage_Lid)
>         ctl.ControlTipText = LoadResString(CLng(ctl.ControlTipText), ,
> varLanguage_Lid)
>
>     Next
>
>
> -----Original Message-----
> From: accessd-bounces at databaseadvisors.com
> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin
> - Beach Access Software
> Sent: Saturday, June 12, 2004 6:48 PM
> To: Access Developers discussion and problem solving
> Subject: Re: [AccessD] Iterating Thorugh Controls
>
> Never mind.  Figured it out.
>
> Rocky
>
> ----- Original Message -----
> From: "Rocky Smolin - Beach Access Software" <bchacc at san.rr.com>
> To: <AccessD at databaseadvisors.com>
> Sent: Saturday, June 12, 2004 9:03 AM
> Subject: [AccessD] Iterating Thorugh Controls
>
>
> Dear List:
>
> I am iterating through the control collection on a form in a public
> procedure to which I pass the name of the form.  The form has a tab form
> on
> it and the controls don't seem to come up. Same with the sub-form on a
> page
> of the tab control.
>
> Is there a particular syntax I need to iterate these controls?
>
> MTIA,
>
> Rocky Smolin
> Beach Access Software
> http://www.e-z-mrp.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