click on print report and you get a choice of the reports u want

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

Guest

I saw in the sample Northwind database that you can click on print report
button and you can get a list of a few reports and you can choose the one u
want - how is this done. I would have just put loads of different buttons on
the form each one for a different report but i think that it looks much more
professional. How is it done

Please can u give me step by step answers!
Thanks!
 
You could make a list box of the reports, with a command button to open the
selected report.

The RowSource query to list all the reports in a database is:
SELECT [Name] FROM MsysObjects
WHERE (([Type] = -32764)
AND ([Name] Not Like "~*")
AND ([Name] Not Like "MSys*"))
ORDER BY [Name];
 
Thanks i got the first part of making a list box but the next part didn't
get. I made a button but it just opens the query how do i make it open any
report.
Also what if i don't want all the reports only a few?
Thanks for your help

Allen Browne said:
You could make a list box of the reports, with a command button to open the
selected report.

The RowSource query to list all the reports in a database is:
SELECT [Name] FROM MsysObjects
WHERE (([Type] = -32764)
AND ([Name] Not Like "~*")
AND ([Name] Not Like "MSys*"))
ORDER BY [Name];

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

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

Database User said:
I saw in the sample Northwind database that you can click on print report
button and you can get a list of a few reports and you can choose the one
u
want - how is this done. I would have just put loads of different buttons
on
the form each one for a different report but i think that it looks much
more
professional. How is it done

Please can u give me step by step answers!
Thanks!
 
In the Click event of the button, use the OpenReport action.

Open the report named in the list box.
This kind of thing:

If Not IsNull(Me.MyListBox) Then
DoCmd.OpenReport Me.MyListBox", acViewPreview
End If

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

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

Database User said:
Thanks i got the first part of making a list box but the next part didn't
get. I made a button but it just opens the query how do i make it open any
report.
Also what if i don't want all the reports only a few?
Thanks for your help

Allen Browne said:
You could make a list box of the reports, with a command button to open
the
selected report.

The RowSource query to list all the reports in a database is:
SELECT [Name] FROM MsysObjects
WHERE (([Type] = -32764)
AND ([Name] Not Like "~*")
AND ([Name] Not Like "MSys*"))
ORDER BY [Name];


Database User said:
I saw in the sample Northwind database that you can click on print
report
button and you can get a list of a few reports and you can choose the
one
u
want - how is this done. I would have just put loads of different
buttons
on
the form each one for a different report but i think that it looks much
more
professional. How is it done

Please can u give me step by step answers!
Thanks!
 
Thanks but where between what line in the visual basics should i put this code.

Also i don't want all the reports to show in the list box - how do i do that?

Allen Browne said:
In the Click event of the button, use the OpenReport action.

Open the report named in the list box.
This kind of thing:

If Not IsNull(Me.MyListBox) Then
DoCmd.OpenReport Me.MyListBox", acViewPreview
End If

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

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

Database User said:
Thanks i got the first part of making a list box but the next part didn't
get. I made a button but it just opens the query how do i make it open any
report.
Also what if i don't want all the reports only a few?
Thanks for your help

Allen Browne said:
You could make a list box of the reports, with a command button to open
the
selected report.

The RowSource query to list all the reports in a database is:
SELECT [Name] FROM MsysObjects
WHERE (([Type] = -32764)
AND ([Name] Not Like "~*")
AND ([Name] Not Like "MSys*"))
ORDER BY [Name];


I saw in the sample Northwind database that you can click on print
report
button and you can get a list of a few reports and you can choose the
one
u
want - how is this done. I would have just put loads of different
buttons
on
the form each one for a different report but i think that it looks much
more
professional. How is it done

Please can u give me step by step answers!
Thanks!
 
Back
Top