Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Print every Item in Combo Box

Status
Not open for further replies.

JasGun

Programmer
Feb 28, 2001
12
GB
Hi,
I wonder if anyone can help.
I have a unbound form, with an Unbound combo box giving me a list of numbers.
I also have 3 sub forms based on queries, in the criteria is the combo box value.
Each time the combo box is change I requery the sub forms and the data changes which is fine.
But, there are 30 items in the combo box & at the moment I select each Item then print the form (which gets tiresome).

So, I would like a procedure that goes through each Item in the combo box and print the form.

I went through the help and thought I could use a procedure something like the one below but getting an error 'Object Doesn't Support This Property or Method'.
Please Help.

Dim ctlList As Control, varItem As Variant

Set ctlList = Forms!frmControlTotals!cmbGroup
For Each varItem In ctlList
Debug.Print ctlList.ItemData(varItem)
Next varItem
 
try it like this

Dim ctlList As Control, varItem As Variant

Set ctlList = me!cmbGroup
For varItem = 0 to ctlList.listcount
Debug.Print ctlList.ItemData(varItem)
Next varItem
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top