Run report from form/switchboard?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
I would like to set up a list box on my switchboard that enables the user to
choose the report they wish to view.
Is this possible? i am having difficulties.
Thanks
George
 
There are several ways to get the names of the reports into a list box. This
article gives two:
List Box of Available Reports
at:
http://allenbrowne.com/ser-19.html
and I recommend the first approach.

A third option is to use a Value List as the RowSourceType, and just type
the names of the reports you wish to expose to the user into tht RowSource
(each one in quotes, separates by commas.)

Once you have the names in the list box named (say) "List1", the code to
open that report is just:
DoCmd.OpenReport Me.[List1], acViewPreview
 
Thanks very much Allen,
I am using the 3rd example you listed below. Where do i put in the code to
view these reports?


Allen Browne said:
There are several ways to get the names of the reports into a list box. This
article gives two:
List Box of Available Reports
at:
http://allenbrowne.com/ser-19.html
and I recommend the first approach.

A third option is to use a Value List as the RowSourceType, and just type
the names of the reports you wish to expose to the user into tht RowSource
(each one in quotes, separates by commas.)

Once you have the names in the list box named (say) "List1", the code to
open that report is just:
DoCmd.OpenReport Me.[List1], acViewPreview

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

George said:
Hi,
I would like to set up a list box on my switchboard that enables the user
to
choose the report they wish to view.
Is this possible? i am having difficulties.
Thanks
George
 
You could:
1) Add a command button to your form.

2) Set the button's On Click property to:
[Event Procedure]

3) Click the Build button (...) beside this.

4) Add the line between the "Private Sub..." and "End Sub" lines.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

George said:
Thanks very much Allen,
I am using the 3rd example you listed below. Where do i put in the code to
view these reports?


Allen Browne said:
There are several ways to get the names of the reports into a list box.
This
article gives two:
List Box of Available Reports
at:
http://allenbrowne.com/ser-19.html
and I recommend the first approach.

A third option is to use a Value List as the RowSourceType, and just type
the names of the reports you wish to expose to the user into tht
RowSource
(each one in quotes, separates by commas.)

Once you have the names in the list box named (say) "List1", the code to
open that report is just:
DoCmd.OpenReport Me.[List1], acViewPreview

George said:
I would like to set up a list box on my switchboard that enables the
user
to
choose the report they wish to view.
Is this possible? i am having difficulties.
 
Back
Top