G
Gert
I use the followin sub to initialise the rowsource of my comboboxes (from an
Access-table) during form-load.
Naamlijst is the name of the list I want to use for a specific combobox.
Veldnaam is the fieldname of the combobox I want to initialise.
FormNaam is the FormName on which the combobox is used.
The sub works fine for normal forms, however, comboboxes on subforms are not
"found". How can I solve this?
Sub InitKeuzelijst(NaamLijst As String, veldnaam As String, FormNaam As
String)
'Init
Dim Sqlq As String
'Init keuzelijst
Sqlq = "SELECT TblKLElement.Omschrijving, TblKLElement.ElementID FROM
TblKeuzelijst "
Sqlq = Sqlq & "INNER JOIN TblKLElement ON TblKeuzelijst.KeuzelijstID =
TblKLElement.KeuzelijstID "
Sqlq = Sqlq & "WHERE (((TblKeuzelijst.Omschrijving)= " & Chr(34) &
NaamLijst & Chr(34) & "));"
Forms(FormNaam).Controls(veldnaam).RowSource = Sqlq
End Sub
Access-table) during form-load.
Naamlijst is the name of the list I want to use for a specific combobox.
Veldnaam is the fieldname of the combobox I want to initialise.
FormNaam is the FormName on which the combobox is used.
The sub works fine for normal forms, however, comboboxes on subforms are not
"found". How can I solve this?
Sub InitKeuzelijst(NaamLijst As String, veldnaam As String, FormNaam As
String)
'Init
Dim Sqlq As String
'Init keuzelijst
Sqlq = "SELECT TblKLElement.Omschrijving, TblKLElement.ElementID FROM
TblKeuzelijst "
Sqlq = Sqlq & "INNER JOIN TblKLElement ON TblKeuzelijst.KeuzelijstID =
TblKLElement.KeuzelijstID "
Sqlq = Sqlq & "WHERE (((TblKeuzelijst.Omschrijving)= " & Chr(34) &
NaamLijst & Chr(34) & "));"
Forms(FormNaam).Controls(veldnaam).RowSource = Sqlq
End Sub