List Box Not Updating

Name is a reserved word and should not be used as a field name.

try removing the rowsource of the list and set it in the after update of the combo. set your column count and column widths as appropriate.

Code:
Private Sub Combo2_AfterUpdate()
Dim strSql As String
strSql = "SELECT ID, txtName, [CVN] & ' - ' & [SNV] AS FullInfo FROM AllData WHERE txtName  = """ & [Forms]![Form1]![Combo2] & """ ORDER BY txtName;"
Debug.Print strSql
Me.List11.RowSource = strSql
End Sub
 
Name is a reserved word and should not be used as a field name.

try removing the rowsource of the list and set it in the after update of the combo. set your column count and column widths as appropriate.

Code:
Private Sub Combo2_AfterUpdate()
Dim strSql As String
strSql = "SELECT ID, txtName, [CVN] & ' - ' & [SNV] AS FullInfo FROM AllData WHERE txtName  = """ & [Forms]![Form1]![Combo2] & """ ORDER BY txtName;"
Debug.Print strSql
Me.List11.RowSource = strSql
End Sub


I have removed the row-source from the list box and set the VBA code to set the row source = strSQL. If I Debug.Print my strSQL and copy/paste the SQL into a query the proper results are displayed. However, when I tab out of the combo box the list box remains empty?
 
The edits I describe work perfectly for me.

Make sure combobox AfterUpdate event property has [Event Procedure].

Try deleting and rebuilding the listbox.

Post your revised db.
 
I see what I did...

under the Properties, Data tab, I cleared both the Row Source and the Row Source Type. Setting Row Source Type back to Table/Query -> has it working exactly as you state it should.

Thanks again!!
 
I see what I did...

under the Properties, Data tab, I cleared both the Row Source and the Row Source Type. Setting Row Source Type back to Table/Query -> has it working exactly as you state it should.

Thanks again!!
Hi. Congratulations! Glad to hear you got it working. Good luck with your project.
 

Users who are viewing this thread

Back
Top Bottom