populate listbox

goldstar1982

Registered User.
Local time
Yesterday, 23:40
Joined
Jan 27, 2008
Messages
10
Hello All,

I currently have an order form, when a record is selected and saved this should appear within the listbox below. i could get this to add but at the same time the order that i have placed from the previous order would display within the same listbox. when i only want the record from the current order that is being placed
This is what i am using...

Code: ( text )
Private Sub populateListbox()
Dim strSQL As String
Dim strcustomername As String
Dim rstLoans As DAO.Recordset
strcustomername = txtorderno.Value

Set rstLoans = dbase.OpenRecordset("tblorder", dbOpenDynaset)
lstOrderDetails.RowSource = ""

strSQL = "SELECTtblorder.orderno,tblorder.ProductID1,tblorde r. [Clothingtype1]"
strSQL = strSQL & "FROM tblorder;"



lstOrderDetails.RowSource = strSQL
End Sub

This is the code that i am currently using. i am stuck plz halp!!!!
 
What field in your table makes it unique for the current order?
 
What RG is getting at is, how are you trying to filter? (*cough* Where is the WHERE statement in your SQL to only return the selected OrderNo? *cough*)

Note that you set a variable like this:

strcustomername = txtorderno.Value

But you never use it anywhere.
 

Users who are viewing this thread

Back
Top Bottom