J
Jac Tremblay
Hi,
I created a simple form with no record source. I just want to set some
parameters through it.
I placed on it a listbox (lstCommande) and a combobox (cboLogoRepas) with no
record source to start with. Their record source is set in the Form_Load
Event.
When the form is displayed the two lists do not work. The list and the combo
do not allow any selection (the contents is OK in both).
What could be the problem?
Here's the Form_Load code:
Private Sub Form_Load()
Dim strSql As String
MsgBox "lngIdRés = " & lngIdRés
' Fill the list.
strSql = "SELECT tblCommande.DateCommande " & _
"FROM tblCommande " & _
"WHERE (((tblCommande.IdRéservation) = " & lngIdRés & _
")) ORDER BY tblCommande.DateCommande; "
Me.lstCommande.RowSource = strSql
Me.lstCommande.SetFocus
Me.lstCommande.Enabled = True
Me.lstCommande.Selected(0) = True
' Fill the combo.
strSql = "SELECT tblLogo.IdLogo, tblLogo.NomLogo " & _
"FROM tblLogo ORDER BY tblLogo.IdLogo; "
Me.cboLogoRepas.RowSource = strSql
End Sub
I am completely lost.
Thanks
I created a simple form with no record source. I just want to set some
parameters through it.
I placed on it a listbox (lstCommande) and a combobox (cboLogoRepas) with no
record source to start with. Their record source is set in the Form_Load
Event.
When the form is displayed the two lists do not work. The list and the combo
do not allow any selection (the contents is OK in both).
What could be the problem?
Here's the Form_Load code:
Private Sub Form_Load()
Dim strSql As String
MsgBox "lngIdRés = " & lngIdRés
' Fill the list.
strSql = "SELECT tblCommande.DateCommande " & _
"FROM tblCommande " & _
"WHERE (((tblCommande.IdRéservation) = " & lngIdRés & _
")) ORDER BY tblCommande.DateCommande; "
Me.lstCommande.RowSource = strSql
Me.lstCommande.SetFocus
Me.lstCommande.Enabled = True
Me.lstCommande.Selected(0) = True
' Fill the combo.
strSql = "SELECT tblLogo.IdLogo, tblLogo.NomLogo " & _
"FROM tblLogo ORDER BY tblLogo.IdLogo; "
Me.cboLogoRepas.RowSource = strSql
End Sub
I am completely lost.
Thanks