List Boxes not linking

  • Thread starter Thread starter Heather
  • Start date Start date
H

Heather

I have a qry that has TradeMonth and A TradeYear field.
So in a form I created a list box that has months 1-12
and years 2002-2004. I want the user to be able to select
say months 1 & 2 and year 2004 I linked the fields to the
form but it does not query. Am I missing something?

TradeMonth [Forms]![frmselectmonth]![LstMnth]
TradeYear [Forms]![frmselectmonth]![LstYR]

I also did this In([Forms]![frmselectmonth]![LstYR])
 
The parameter method that you are using in the query does not comprehend
multi-select list boxes. You will need to use a VBA function to parse the
selected values from the listbox for use in a query.

The ItemsSelected collection of the Listbox control can be traversed, which
can help you write an inline sql such as:

Select * from tblName WHERE SomeID IN (1,4,5)

--
HTH,

Steve Clark, Access MVP
FMS, Inc.
Professional Solutions Group
http://www.FMSInc.com
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Is your Access database too slow?
Are you ready to upgrade to SQL Server?
Contact us for optimization and/or upsizing!
http://www.FMSInc.com/consulting
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
 
Back
Top