Access form dynamic translation and form orientation

phme 1 Reputation point
2021-12-14T18:11:30.743+00:00

I would like to create a multilingual application with forms in both left-to-right (such as English) and right-to-left (such as Arabic). The end goal is to allow users to to change the display language and have the same form shown in English or Arabic. The forms designs are frequently updated.

I wrote VBA code that dynamically mirrors vertically all controls of a form, translate labels, changes control sources, etc. There are two things that bother me:

  1. The Orientation property of a form can only be changed when the form is design mode. This would mean that I can't have completely dynamically translated forms, and that I need to keep separate RTL and LTR versions of the form. This is an option, but a bit tedious to maintain when forms change frequently. In particular because forms rely on subforms and VBA code, so I also need to make sure to change SourceObject
  2. I didn't find a way to mirror controls when using layouts. The way I'm mirroring controls is to compute the controls' Left property (based on initial position, control width and form width). However, the controls positions within the layout supersede this, and I don't see any option to control layouts through VBA. A way around this is to make do without layouts -- but layouts are really useful to keep everything well aligned.

Any idea of strategies that I could implement for this?

Microsoft 365 and Office | Access | Development
0 comments No comments
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.