Connecting Tech Pros Worldwide Help | Site Map

dynamic report columns

 
LinkBack Thread Tools Search this Thread
  #1  
Old March 14th, 2008, 06:55 PM
bobh
Guest
 
Posts: n/a
Default dynamic report columns

Hi All,

Has anyone come across or have code where a user can select what data
fields they want(lets say from a multi-select list box) and have them
be the columns in a report.

thanks
bobh.

  #2  
Old March 14th, 2008, 10:15 PM
Salad
Guest
 
Posts: n/a
Default Re: dynamic report columns

bobh wrote:
Quote:
Hi All,
>
Has anyone come across or have code where a user can select what data
fields they want(lets say from a multi-select list box) and have them
be the columns in a report.
>
thanks
bobh.
Hi Bob:

The following link is for a different type of problem but I think some
of the concepts you learn there can be applied to your probem. (For
those of you doing crosstab reports it's really a good/great article.)
http://www.fmsinc.com/tpapers/access...hly/index.html

Could you describe your problem a bit more fully. Let's say you have
1/1/2008, 1/2/2008...1/31/2008 in a listbox, do you have table columns
with those field names? Or did you want to print those dates in
respective column positions?

For a listbox, you should be able to check the selected property and
create a string.
Dim strD As String
Dim intFor As Integer
Dim I As Integer
'has col header, this start at 1
For intFor = 1 To Me.ListBox.ListCount - 1
If Me.ListBox.Selected(intFor) = True Then
'create a string 01/01/2008 As Month1...Monthn
strD = strd & Me.ListBox.Column(0, intFor) & _
" As Month" & i & ", "
End If
Next

You can open up the report and change the recordsource for it.

I think if your problem was described a bit more verbosely you'll get a
better answer.

Maladum
http://www.youtube.com/watch?v=Ym9z3MBjwho

 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,662 network members.