Mehrsprachigkeit

Private Sub Form_Open(Cancel As Integer)
   SetLang Me
End Sub
Public Function SetLang(ByVal myForm As Form) As Integer
   Dim res As Integer
   res = 0
   Dim ctr As Control
   For Each ctr In myForm
      Debug.Print ctr.Name & ": " & ctr.ControlType
      Select Case ctr.ControlType
         Case 100 '*Label
            ctr.Caption = Translate(myForm.Name & "." & ctr.Name)
         Case 112 '*Unterformular
            SetLang ctr.Form
      End Select
    Next
   SetLang = res
End Function
 
Public Function Translate(ByVal key As String) As String
   Dim res As String
   res = key
   '***** eigenen Code zur Übersetzung implementieren ***
   res = "to be translated"
   '* übersetzten Begriff zurückegeben
   Translate = res
End Function