Multilanguage combo box

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I want to be able to use multi language combo boxes in a form. The user must
be able to switch between English and Dutch.
Data in the database, from the combobox should be stored in one language only.
How should that be done?
I started with double combobox table :
Id
Txt_NL
Txt_GB
And tried to change the combo box property with:
If LangToggle = True Then
ComboBox.RowSource = "TheTable"
CpmboBox.BoundColumn = 1
Else
ComboBox.RowSource = "TheTable"
CpmboBox.BoundColumn = 2
End If
But that didn't work.
 
Bob,

The BoundColumn property has to do with the column whose value is returned
by the combo in the case of a multi column combo, not with what is
displayed. Try sopmething like this instead:

If LangToggle = True Then
ComboBox.RowSource = "SELECT Txt_NL FROM TheTable"
Else
ComboBox.RowSource = "SELECT Txt_GB FROM TheTable"
End If

With this code, the value reurned from the combo will be the text itself,
not the Id. If you need the Id returned, then set the combo's Column Count
property to 2, the Column Widths property to something like: 0;2 (so that
the first column won't be visible) and the Bound Column property to 1 (so
that the bound column is the first, invisible column). Then change your code
to:

If LangToggle = True Then
ComboBox.RowSource = "SELECT Id, Txt_NL FROM TheTable"
Else
ComboBox.RowSource = "SELECT Id, Txt_GB FROM TheTable"
End If

The combined result of all of this is that the combo displays only one
column wihthe selected language text, but returns the corresponding Id
value.

HTH,
Nikos
 
Back
Top