Results 1 to 7 of 7
  1. #1
    New Lounger
    Join Date
    May 2002
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Access application in 2 languages (Access 2003)

    I need to design an Access application that will cater to both English speaking and Vietnamese speaking users. I do not want to clutter forms with both languages but would rather let users switch frrom one to the other and then display only the forms in the requested language.
    Data does not need to be bilingual, only commands, labels and captions.
    What is the most efficient approach for such a bilingual system?
    Design each form in both language (this would double the code and make changes more laborious)?
    Have an IIF statement for each label caption ?
    Have a dictionary table and lookup values when opening each form?
    PS: code editor does not seem to support VIetnamese fonts, but there is no problem in tables or properties

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Access application in 2 languages (Access 2003)

    I think I'd use a dictionary table and code in the On Open event of each form and report that loops through the controls of the form and looks up the caption for labels and command buttons. The advantage is
    - You have one central place where the translations are stored, so it is easy to edit them or add new ones.
    - The code is the same for all forms and reports, so you can put a procedure in a standard module and call that from the On Open events.

  3. #3
    4 Star Lounger SteveH's Avatar
    Join Date
    Jan 2001
    Location
    Chelsea, Gtr London, United Kingdom
    Posts
    587
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Access application in 2 languages (Access 2003)

    I happen to have a demo which will do most of what you want (I think).

    The problem I can see still is how to deal with a different character set for Vietnamese (if it needs one)?
    Steve H
    IT Lecturer/Access Developer
    O2K SR3/O2010; Win7Pro

  4. #4
    New Lounger
    Join Date
    May 2002
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Access application in 2 languages (Access 2003)

    Hans,

    Thanks. Having a single procedure in standard module is a very good idea. BTW, how do I cycle through each form's labels and command in VBA?

  5. #5
    New Lounger
    Join Date
    May 2002
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Access application in 2 languages (Access 2003)

    Steve,

    Thanks. Your code actually gave me a lot of good ideas (for that particular problem and others !). BTW, Vietnamese fonts are no problem on unicode machines (the only place it won't work is in code itself, but tables are OK).

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Access application in 2 languages (Access 2003)

    Here is how you could do it:

    In each form's module:

    Private Sub Form_Open(Cancel As Integer)
    SetCaptions Me
    End Sub

    In a standard module:

    Public Sub SetCaptions(frm As Form)
    Dim ctl As Control
    For Each ctl In frm.Controls
    Select Case ctl.ControlType
    Case acLabel, acCommandButton, acToggleButton
    ' Fill in specific code here.
    ctl.Caption = DLookup(...)
    End Select
    Next ctl
    Set ctl = Nothing
    End Sub

  7. #7
    New Lounger
    Join Date
    May 2002
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Access application in 2 languages (Access 2003)

    This looks great. Thanks.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •