Adding a variable to a listbox specific row (Table/query)

jan pieter

Registered User.
Local time
Today, 03:06
Joined
Dec 28, 2013
Messages
15
Jan Pieter here,

The VBA code I have at the moment:
me.Results.Rowsource = "SELECT car, title, FROM dbo_inventory"

Is it possible to add a variable to a specific row in listbox using the code above?
In this case the price?

Some help would be appreciated :)

- Jan Pieter
 
sure

SELECT car, title, price FROM dbo_inventory

make sure you modify the listbox to 3 columns and adjust width accordingly
 
Thanks for the reply CJ_London,

I have a variable that is called Price that I calculated in VBA and that price differs from car to car.

Is it still possbiel to add this variable to the Rowsource in vba ?

Thanks in advance

- Jan Pieter
 
depends on how you relate the price to the row.

Rather than a table/query rowsource you can use a value list - then use your sql in vba to create the value list and add the price where required

Or you can turn your VBA that calculates the price into a function and incorporate it into your rowsource sql.

Either way you need to be able relate the price to the row.
 

Users who are viewing this thread

Back
Top Bottom