B
Billy B
I have a table with a field name of Purchased. It is a number, integer,
decimal places = 0.
I have a form with a list box. The list box shows the StoreNumber (an
integer, decimal places Auto and no default) and StoreName from a different
table. When the user picks a store from the listbox, I want to open a form
based on that store number. Below is the SQL statement. The form opens OK but
shows all records in the table. If the selection from the list box was
StoreID 2, I get a 2 character variable (I used the Len function and result
was that intstorenum is 2 characters long). What am I missing?
intStoreNum = Val(lstFindOptions.Column(0))
strCriteria = "SELECT DISTINCT tblPlants.PlantID, tblPlants.PlantName,†_
“tblPlants.Alias, tblPlants.BotonName, tblPlants.PlantType,
tblPlants.PlantCat, “ & _
tblPlants.GrowthSize, tblPlants.PlantingLoc, tblPlants.Description,
tblPlants.Culture, tblPlants.Moisture, tblPlants.HardinessZones,
tblPlants.Features, tblPlants.Usage, tblPlants.PlantWarnings,
tblPlants.PicPath FROM tblPlants WHERE tblPlants.Purchased = & intStoreNum &"
Thank you.
decimal places = 0.
I have a form with a list box. The list box shows the StoreNumber (an
integer, decimal places Auto and no default) and StoreName from a different
table. When the user picks a store from the listbox, I want to open a form
based on that store number. Below is the SQL statement. The form opens OK but
shows all records in the table. If the selection from the list box was
StoreID 2, I get a 2 character variable (I used the Len function and result
was that intstorenum is 2 characters long). What am I missing?
intStoreNum = Val(lstFindOptions.Column(0))
strCriteria = "SELECT DISTINCT tblPlants.PlantID, tblPlants.PlantName,†_
“tblPlants.Alias, tblPlants.BotonName, tblPlants.PlantType,
tblPlants.PlantCat, “ & _
tblPlants.GrowthSize, tblPlants.PlantingLoc, tblPlants.Description,
tblPlants.Culture, tblPlants.Moisture, tblPlants.HardinessZones,
tblPlants.Features, tblPlants.Usage, tblPlants.PlantWarnings,
tblPlants.PicPath FROM tblPlants WHERE tblPlants.Purchased = & intStoreNum &"
Thank you.