This what I have, it is function in my on_click on my form where the two listboxes are. All I am tring to do is passing the products from one listbox one by one in the dcount fuction and then adding the result to another listbox on the same form.
For intItem = 0 To Me!lstAllProduct.ListCount - 1
Totals = DCount("[Product]", "Bulletins", "[Product]= '" & Me![lstAllProduct] & "'"
Totals = Totals + 1
lststr = CStr(Totals) & IIf(intItem = 0, "", ";" & lststr)
Me!txtSequence.RowSource = lststr
Next intItem
The problem is that My Dcount fuction is working only when i manually select the product in the lstAllProduct that is I have to first select the product (itemselected property then only it knows which product to pass through dcount fuction and insert the result into the other listbox. What am I doing wrong. Is there a way that the fuction can automatically select the list and then pass the products one by one into the for loop.
Please help...
For intItem = 0 To Me!lstAllProduct.ListCount - 1
Totals = DCount("[Product]", "Bulletins", "[Product]= '" & Me![lstAllProduct] & "'"
Totals = Totals + 1
lststr = CStr(Totals) & IIf(intItem = 0, "", ";" & lststr)
Me!txtSequence.RowSource = lststr
Next intItem
The problem is that My Dcount fuction is working only when i manually select the product in the lstAllProduct that is I have to first select the product (itemselected property then only it knows which product to pass through dcount fuction and insert the result into the other listbox. What am I doing wrong. Is there a way that the fuction can automatically select the list and then pass the products one by one into the for loop.
Please help...