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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

printing listboxes

Status
Not open for further replies.

skate

Technical User
Nov 29, 2002
65
CA
Please help! I've tried searching through the threads to see but can't find enough information on how to print out the records displayed in my listbox in a report. I know i have to do a loop of some sort, but I really need some help. Anyone? I'm not that experienced w/ access. Thanks in advance.
 
Hi,
The question I have is this: do the contents of the listbox come from a table, a query, or a value list?

If the listbox contents come from either a table or a query, you can simply use this as the recordsource for the report. If it is a value list, it can still be done. If this is the case, please reply to this thread and I will give you the code to loop through the listbox. HTH,
Randy Smith
California Teachers Association
 
well....i used this code that i found somewhere...uses something like strsql=select....
strsql=strsql & where statement....
i guess that means it's taking it from a query...
 
Hi,
I think there is a little misunderstanding here. When you create a listbox on a form, there are two ways of setting up the values.

1) Within the listbox control on the form, you can simply type in a value list. This is under Properties, Data tab, Row Source Type = Value List, and Row Source has a list of items separated by semi-colons.

2) The second technique of having a listbox is to have it based on a query or table. If this is the case, then creating a report to show this info is very simple. To see if this is the source of your values within the listbox, simply go to Properties, Data tab, Row Source Type = Table/Query, and the Row Source will show the source of the values.

Now, to create a report showing all the items in your listbox is relatively simple, unless it is coming from a value list as I explained in #1. If this is the case, then you may want to copy those values out and place them into a new table. (You don't need to get into creating SQL statements.) Now that you have a table containing the listbox values, you can use that as the recordsource for a new report.
HTH,
Randy Smith
California Teachers Association
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top