473,473 Members | 2,207 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

open report in a succession

In order to check for figures i want to make a function that opens and
closes a report in a succcession depending on the option values
chosen.Instead of clicking on the option group called Houses, i use the
value of the field :
Dim stDocName As String
stDocName = "RptHouseReport"

Me!Houses.Value = 1
DoCmd.OpenReport stDocName, acPreview
DoCmd.Close acReport, "RptHouseReport"
Me!Houses.Value = 1
DoCmd.OpenReport stDocName, acPreview
DoCmd.Close acReport, "RptHouseReport"

Me!Houses.Value = 3
DoCmd.OpenReport stDocName, acPreview
DoCmd.Close acReport, "RptHouseReport"
etc... etc....

However my function stops at the first report,, it opens the report for
the first option and then stops, it stays wih the report opened.What is
the reason for my wrong function ?

Nov 13 '05 #1
1 1338
> In order to check for figures i want to make a function that opens and
closes a report in a succcession depending on the option values
chosen.Instead of clicking on the option group called Houses, i use the ....... However my function stops at the first report,, it opens the report for
the first option and then stops, it stays wih the report opened.What is
the reason for my wrong function ?
You should ask first if this is what you really want. If your code says:
DoCmd.OpenReport stDocName, acPreview
DoCmd.Close acReport, "RptHouseReport"


then what are you gaining if it opens and closes immediately? The idea of
preview mode is for you to be able to look at it, or print it, or take
another action. So if your code *did* execute as you intended, then you
would have no chance to really view the report

Take out the DoCmd.Close. When your user closes the report by clicking on
the 'X', it will close.

BTW, I would recommend having error-handling in every function that opens a
report.

--
Darryl Kerkeslager
Nov 13 '05 #2

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

Similar topics

46
by: Steve | last post by:
Access97 Database The database is split into a frontend and backend and not connected to any other database. The database has an unbound report with 15 subreports. Some of the subreports include...
8
by: lauren quantrell | last post by:
When I open an Access form I can have no recordset specified, then in the form's OnOpen event I can do something like: Me.paramaters = "@SomeColumn = 22)" Me.recordsource = "dbo.sproc123" But I...
6
by: Shamin | last post by:
Hi, Thanks in advance for answering to my Question. I'm stuck with this problem and would really appreciate any help. I have 2 aspx files (Main.aspx and ReportViewer.aspx). Main.aspx has a...
7
by: Steve_Black | last post by:
Hello, I'm toying with the idea of loading a MenuStrip (VB.Net 2005) dynamically based on who is logged into my system. Every user has different security settings and I want to customize the...
12
by: Orchid | last post by:
Hello all, I have different version of reports which used for different months. For example, I am using report version 1 up to September, but we have some design changes on the report for October,...
4
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - How do I open a new window with javascript?...
7
by: martin DH | last post by:
Hello, I have a report that I open that pull its data from a form that builds a where string. Opening the report first opens the form, where I enter criteria, and then pulls matching records from a...
3
by: Naushad | last post by:
Hi All, I am trying to open the report conditionally from the dialogue box form. In the form there are three field. cboEmployees StartDate EndDate I have used these field in criteria to...
1
by: littlbit755 | last post by:
I am using Access 2003 at work and had created a summary report showing the financial information for year to date. As of last week the report ran great. Today I was asked to make a change in the...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.