need to know total number of items in the listbox and pass the value to an integer
I am designing a Form application in Access 2003.
I have a listbox containing data populated on basis of a selection in a combo box. I need to pass the rowcount of the listbox to an integer variable for furthur process. my combo box contains Date, my list box returns customer names for a Date selected.
I thought about two different approaches, but not successful yet.
1. I want to Dim ListControl as Control, try to use ListCount.
2. I tried to use Dcount function which needs taking the value of selection of the combo box as criteria in the function. I can write a query as expression to get same records as those populated in the list box.
Dcount("customer", "qry", "orderdate = Form!frm_master!cbo_orderDate"), my problem is that my criteria code is not right.
Ready to showcase your work, publish content or promote your business online? With Squarespace’s award-winning templates and 24/7 customer service, getting started is simple. Head to Squarespace.com and use offer code ‘EXPERTS’ to get 10% off your first purchase.
U may perhaps need to wrap OrderDate with CDATE but I think u should be ok
Im off home now, see ya all
0
jc50967wAuthor Commented:
Rockiroads, my combo box only has one column. The filed name OrderDate is just example name I used to discribe in this case. My real database, tables and fields are with very complicated business concept, and hard to post them in few lines. Then I use customer and their order as example case in here.
you now know how to get a listcount and Ive told you about the error you had in your dcount
I mentioned the multicolumn just in case, but its not a problem now since u only have the one column.
Did the correction to the DCOUNT work? (after u change it to your fields that is)
0
Question has a verified solution.
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Squarespace’s all-in-one platform gives you everything you need to express yourself creatively online, whether it is with a domain, website, or online store. Get started with your free trial today, and when ready, take 10% off your first purchase with offer code 'EXPERTS'.
x=me.listboxname.listindex