Guess who's back, back again...
Hi all,
Hopefully someone can shed some light on this, as I can't seem to work it out.
I have a list box, that populates itself when a button is pushed, using the follow:
Code:
strMLSQL = "SELECT [Product vName] " & _
"FROM main INNER JOIN ref_products ON ref_products.[Product Code] = main.[Product Code] " & _
"WHERE [ID] IN (" & ids & ")"
I then use:
Code:
mainList.RowSource = strMLSQL
Which works fine, not a problem there.
Now, I have two columns setup in this 'mainList' listbox. The second column in each row, I want to be populated with the quantity of each product. Sooo... I created a recordset which does the job, using:
Code:
Dim rsTmp As DAO.Recordset
Dim tmpInt As Integer
Set rsTmp = CurrentDb.OpenRecordset(strMLSQL)
rsTmp.MoveLast
tmpInt = rsTmp.RecordCount
Which does the job of assigning the quantity involved within the tmpInt variable.
The problem is, I want both 'strMLSQL' and 'tmpInt' to populate the listbox. I've tried:
Code:
mainList.RowSource = strMLSQL, tmpInt
But, as you'd expect, SYNTAX ERROR!!!
What I'd like to know is:
1) Is this possible?
2) If so, how should I go about it?
3) If not, how else can I achieve the desired results?
Thanks in advance guys, hope that's clear enough. I've tried google, but it doesn't like long search strings.