473,386 Members | 1,943 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

print preview problem

Hi

Can anyone tell me why I get this error message "Object doesn't support this
property or method."
at the line "Set rpt = Reports!shipping".

The funny thing, is that the same code works fine when placed behind a
button
on some forms but not others.
Dim rpt As Access.Report

DoCmd.OpenReport "shipping", acViewDesign
Set rpt = Reports!shipping
rpt.RecordSource = "qry_shippingCourier"

DoCmd.OpenReport "shipping", acPreview
Thanks in advance

Mick
Nov 12 '05 #1
2 2239
"Michael Turner" <tu****@impedimed.com> wrote in message
news:T0*****************@news-server.bigpond.net.au...
Hi

Can anyone tell me why I get this error message "Object doesn't support this
property or method."
at the line "Set rpt = Reports!shipping".

The funny thing, is that the same code works fine when placed behind a
button
on some forms but not others.
Dim rpt As Access.Report

DoCmd.OpenReport "shipping", acViewDesign
Set rpt = Reports!shipping
rpt.RecordSource = "qry_shippingCourier"

DoCmd.OpenReport "shipping", acPreview


I don't know why you get the error, but thought I would point out that you can
set the RecordSource property of a Report in its own Open event and eliminate
the need to open it in design view.
--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com
Nov 12 '05 #2
Let me ask the question ... Why do you want to change recordsource?

Now the answer: If you want to conditionally set the recordsource,
then set it in the Report_Open event. Pass the name of the query in
via the OpenArgs parameter of the DoCmd.OpenReport method.

If you're in Access 97 where there is no OpenArgs for Reports, then
create a public Property Get, Property Let pair (or just a public variable)
to store the value before opening the report, and then retrieve it from
the open event of the report.

This thing about opening an object in design view is whacked. It won't
work in an MDE at all and in an MDB it will create bloat.
--

Danny J. Lesandrini
dl*********@hotmail.com
http://amazecreations.com
"Michael Turner" <tu****@impedimed.com> wrote ...
Hi

Can anyone tell me why I get this error message "Object doesn't support this
property or method."
at the line "Set rpt = Reports!shipping".

The funny thing, is that the same code works fine when placed behind a
button
on some forms but not others.
Dim rpt As Access.Report

DoCmd.OpenReport "shipping", acViewDesign
Set rpt = Reports!shipping
rpt.RecordSource = "qry_shippingCourier"

DoCmd.OpenReport "shipping", acPreview
Thanks in advance

Mick

Nov 12 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
by: Neo Geshel | last post by:
I'm helping on a web site, and it's got our knickers in a knot. We're using the same basic CSS files (with mods) and same headers as from our other sites, but the "print preview" won't work...
7
by: Pat | last post by:
I would like to send the Print Preview of a MS Access form to a Snapshot file. The form contains an OLE graph. BACKGROUND A snapshot of a report is possible. If I could I would use a report to...
0
by: Malcolm Cook | last post by:
I've discovered: Using "File > Print Preview" in a form's datasheet view with a server Filter crashes access after previewing... ....that is, unless ServerFilterByForm has been turned off...
1
by: sea | last post by:
I have Access 2002 and I am writing this application with a custom menu bar that has a print preview button -- the start up options hide the design window. The problem is that when an open form is...
0
by: John | last post by:
I have a class that creates an AxWebBrowser object in the background, loads some arbitrary html content, then shows the user a print preview. The only problem is, this print preview is a tiny...
0
by: ShaneO | last post by:
There have been similar questions raised in the past, however no answers seem to have been provided, so I thought I'd give it a go. Scenario 1: My Windows Forms app generates (say) 10 pages in a...
6
by: CSharpguy | last post by:
In my gridview I have 2 -3 template fields which are hyperlinks. I allow the user to print this grid. When the grid prints it also prints the links, how can I take the user to a print preview page...
2
by: Brad Pears | last post by:
I have a vb.net 2005 application and am using the print preview screen. This screen has a printer icon on it that the user can use to print the document currently being viewed. It uses the default...
11
by: Gord | last post by:
When I open a certain report, it runs some code that generates the records that will be displayed in that report. This works fine. When I go to print preview the report it appears that the code...
4
by: scubasteve | last post by:
I've developed a product pricing application for a client in AC2007. They enter all the data on the one main form, then click a button to open a printable report in Print Preview. My problem...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.