Problem with changing to multi-language in navigation form (1 Viewer)

wire_jp

Registered User.
Local time
Today, 14:07
Joined
Jun 23, 2014
Messages
64
Hello All,

I have setup a Microsoft Access 2010 database with a Switch Board form which has a link to a navigation form which contains all of my forms. The SwitchBoard has a label containing some text; some command buttons and a combo-box which contains the different Language options (English, French, Spanish). I used VBA code to code my Switch Board and I was able to make this form convert the English text into the different languages and to convert the text in the label and command buttons to foreign language text. The language controls are maintained in 3 tables:

I have all of the language translations in a table called tblControlCaption table: -

Code:
ControlID: CtlID  - Autonumber
Control Name: CtlName - Short Text
Control Type: CltType - Short Text
ControlCaption:CltCaption - Short Text
frmName:Form Name - Short Text
Language ID: LanguageID - Short Text (FK)
Control Active:CltActive - Yes/No

Then I have a second table called tblLanguages table:-
Code:
ID: ID - Autonumber
LanguageID: LanguageID - Short Text
LanguageDisplayName - Short Text

A third table called tblDefLanguage table:-
Code:
ID: ID - Autonumber
Default Language: DefLanguage - Short Text

Now I want to convert the text of the labels, buttons, check lists in the MainNavigation form to multi-languages. SoI started to add the labels, buttons to the tblControlCaption table from the other forms individually. I then On Load Event of the forms to link to the query with the stored Language Default. The Language on the labels/buttons in the forms change to the new foreign language. However, in the Navigation Form, there the language on the labels/buttons remain in English and did not change. Also, I noticed that if I click the link on the SwitchBoard form to access the navigational form, I get an error message that no reference exist and the form cannot be found. However, if I remove the On Load Event on the individual forms, then I do not get an error message when I click the link on the SwitchBoard form.

When this did not work, I tried to select one of the subform (i.e.MainItem form) of the Navigation Form and click on On Load Event and added the attached VBA code but I got an Error 13 type mismatch: -
Code:
Private Sub Form_Load()
On Error GoTo frmLoadErrHandler

Dim btnDefLanguage As String
Dim btnLanguageShow As String

'To lookup the Foreign Language from the Query qryLookupLanguage
btnDefLanguage = DLookup("LanguageDisplayName", "qryLookupLanguage")

ctlLoad Forms![frmMainNavigation]![Child3], DLookup("DefLanguage", "tblDefaultLanguage")

frmLoadErrExit:
Exit Sub
frmLoadErrHandler:
MsgBox Err.Description, vbExclamation, "Error#" & Err.Number
Resume frmLoadErrExit

End Sub

Please advise.
 

isladogs

MVP / VIP
Local time
Today, 21:07
Joined
Jan 14, 2017
Messages
18,186
The built in Navigation form is notoriously difficult to modify to an significant extent.
You seem to have a good example of this.

Sorry but I think you may have to make your own navigation form if you need this functionality.

Another special form likely to cause issues is the split form
 

wire_jp

Registered User.
Local time
Today, 14:07
Joined
Jun 23, 2014
Messages
64
Hello Colin,

Thank you for your prompt response. I figured the problem was due to the Navigation form setup.

Thanks again.
 

Users who are viewing this thread

Top Bottom