A
Access infant
Hai,
I have a form in which there's a list box and two command buttons
1. cmdPrepareReport for selected
2. cmdPrepareReport for all
for the first command button i used the following code
For Each varItem In Me!lstCName.ItemsSelected
' Grab the ContactID column for each selected item
strWhere = strWhere & Me!lstCName.Column(0, varItem) & ","
' the last comma will be removed later
Next varItem
This strWhere will be later passed to the report as criteria
If the second button is selected, I must grab the contactId of all records
in the rowsource. can any one tell me how to do this?
I have a form in which there's a list box and two command buttons
1. cmdPrepareReport for selected
2. cmdPrepareReport for all
for the first command button i used the following code
For Each varItem In Me!lstCName.ItemsSelected
' Grab the ContactID column for each selected item
strWhere = strWhere & Me!lstCName.Column(0, varItem) & ","
' the last comma will be removed later
Next varItem
This strWhere will be later passed to the report as criteria
If the second button is selected, I must grab the contactId of all records
in the rowsource. can any one tell me how to do this?