473,395 Members | 1,641 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,395 software developers and data experts.

Microsoft Access 97 report

I am trying to create a report which only displays the most current
record so the user can publish with word just the most current record
to email this out to a DL.
Thank you in advance.

Nov 13 '05 #1
7 1968
Hi Heather

I had to do the very same thing (in Access 2000, hope its the same) -
but before I go into how let me make sure I understand you correctly.
Should the report be triggered from a form? So when you are looking at
a certain record in a form you can click and button and the record you
were viewing is outputted to word?

If yes, then this is how I did it.

1. Create your report. The report does not need to be based on a
query or have a datasource.

2. Drop unbound text boxes into the reports to hold your fields. Type
the names of the fields in your form into the report text boxes in the
following format:
=[Forms]![nameOfYourFormGoes Here]!nameOfFieldGoes Here
This is telling the report to use the currently selected record of the
specified form as the source for the specified field. Obviously for
the report to work the form must be open and a record selected.

3. Save your report. Go into Macros section, and create a new macro.
Set the first action for your Macro to 'OutputTo'. Set object type to
'Report', set object name to the name of your report, set output
format to Rich Text Format, and set the other fields here according to
your preference. Save the macro.

4. Open your form in design view and drop a command button into an
appropriate place. In the properties for your button, under 'on click'
select your newly create macro.

That should be it - although as an extra you could even get Access to
fire up the e-mail and attach the Word doc. To do this you use the
macro command 'SendObject'.

Hope this is what you were looking for!

Nov 13 '05 #2
Hi Heather,

You must have already designed your report for the wizard to do its best
work.

In design mode on the form in question and with wizards enabled on the
Toolbox, select the command button and create a command button on your form.
The wizard will step you through it. When the wizard is done. You'll need
to get into the event code for the Click procedure and insert a WHERE clause
something like

"[PeopleID] = " & PeopleID

in the OpenReport line.

HTH
--
-Larry-
--

"Heather" <HW******@cox.net> wrote in message
news:11*********************@z14g2000cwz.googlegro ups.com...
I am trying to create a report which only displays the most current
record so the user can publish with word just the most current record
to email this out to a DL.
Thank you in advance.

Nov 13 '05 #3
This works great! The way it is displayed now is my form is still
fine. My report now displays the correct data (only the current
record) except it puts it on as many pages as my form is. For example,
My form is 5 pages. (01/05/05, 01/06/05, 01/07/05, 01/08/05, 01/09/05)
My report displays (01/09/05, 01/09/05, 01/09/05, 01/09/05, 01/09/05)
Is there syntax to only display one of these pages?

Nov 13 '05 #4
Hi Heather,

I don't understand your design. If the Primary Key field of your underlying
table is PeopleID then the where clause I gave you would open the report
with just one record in the report. Paste the code below into the Click
event of your Print Command Button. Substitute the names of the objects in
your application for the names in the subroutine below. The code below was
copied from the Click event of a command button that opens a report
Previewing one Person's record.

================================================== ======
Private Sub cmdPrintPersonRecord_Click()
On Error GoTo Err_cmdPrintPersonRecord_Click

Dim DocName As String

Me.Refresh

DocName = "rptLionPeople"
DoCmd.OpenReport DocName, A_PREVIEW, , "[PeopleID] = " & PeopleID

Exit_cmdPrintPersonRecord_Click:
Exit Sub

Err_cmdPrintPersonRecord_Click:
MsgBox Error$
Resume Exit_cmdPrintPersonRecord_Click

End Sub
================================================== =========

If the code doesn't work for you then post back with more information about
the design of your application. Especially give the name of the underlying
table and the names and datatypes of the first several fields in it. If the
above code returns several records then the Primary Key isn't a primary key
at all. When you set a primary key, no duplicates are allowed.

HTH
--
-Larry-
--

"Heather" <HW******@cox.net> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
This works great! The way it is displayed now is my form is still
fine. My report now displays the correct data (only the current
record) except it puts it on as many pages as my form is. For example,
My form is 5 pages. (01/05/05, 01/06/05, 01/07/05, 01/08/05, 01/09/05)
My report displays (01/09/05, 01/09/05, 01/09/05, 01/09/05, 01/09/05)
Is there syntax to only display one of these pages?

Nov 13 '05 #5
Hello Larry,
You are probably confused because that reply was supposed to be
attached and directed to boiled egg's response. I tried to click on
show options next to boiled eggs name and send that person an email,
but i dont know if it got there. I really appreciate the help though.
Maybe you can help by reading my original message at the top I guess
you see what I see, and then reading boiled eggs response and then my
question to boiled egg. Sorry for the confusion.
Heather

Nov 13 '05 #6
Boiled Egg,
This works great! The way it is displayed now is my form is still
fine. My report now displays the correct data (only the current
record) except it puts it on as many pages as my form is. For example,
My form is 5 pages. (01/05/05, 01/06/05, 01/07/05, 01/08/05, 01/09/05)
My report displays (01/09/05, 01/09/05, 01/09/05, 01/09/05, 01/09/05)
Is there syntax to only display one of these pages?
Does this have something to do with the primary key?
Thank you.
Heather

Nov 13 '05 #7
Hi Heather,

You'd have to give us your table design and the design (SQL) of the query in
your report to better understand your issue. As I understand it now you're
getting identical data on several printed pages with different dates on each
page. What does that mean? A different date where. how displayed?

--
-Larry-
--

"Heather" <HW******@cox.net> wrote in message
news:11**********************@c13g2000cwb.googlegr oups.com...
Boiled Egg,
This works great! The way it is displayed now is my form is still
fine. My report now displays the correct data (only the current
record) except it puts it on as many pages as my form is. For example,
My form is 5 pages. (01/05/05, 01/06/05, 01/07/05, 01/08/05, 01/09/05)
My report displays (01/09/05, 01/09/05, 01/09/05, 01/09/05, 01/09/05)
Is there syntax to only display one of these pages?
Does this have something to do with the primary key?
Thank you.
Heather

Nov 13 '05 #8

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

Similar topics

1
by: Joris Kempen | last post by:
Hi people, I know that the question has come around sometimes: How to open an Access Report using ASP and export it to for example RTF. I'm trying to implement the first method of David...
8
by: Mike MacSween | last post by:
tblCourses one to many to tblEvents. A course may have an intro workshop (a type of event), a mid course workshop, a final exam. Or any combination. Or something different in the future. At...
1
by: ellipsys | last post by:
- Open Access 2003 - Create new database (2000 or 2002/2003 format) - Create a report and insert a label in its Detail section - Save the report as Report1 - Copy Report1 as Report2 - Open...
1
by: Brian Barnes | last post by:
I've been searching using google trying to find a way to display Access Reports via ASP.NET and only finding commericial products which appear to require that the report needs to be converted every...
6
by: Bob Alston | last post by:
I am looking for Access reporting add-in that would be easy to use by end users. My key focus is on selection criteria. I am very happy with the Access report writer capabilities. As far as...
5
by: enginerd477 | last post by:
I am having trouble getting my database to do what i want. I have a form with autonumbers which are going to be the numbers of some inventory. the inventory has reports in word or other program. ...
0
by: vaahini | last post by:
i have upgraded our database from microsoft access 97 to microsoft access 2000. While executing i face problem (Unknown database found) in crystal report 7.0. How to solve this problem. the platform...
8
by: gersam | last post by:
I have Microsoft Access 2003 and i have a report of Crystal Report 10, i want to configure the Crystal report viewer in Microsoft Access to run this report, but i don't know how to do it. The...
0
by: flomaster | last post by:
Hi, I have created a c# application which uses Microsoft Access Reports. The application works ok on my laptop but when I installed it on other pcs ( more than 5 ) the following problem appears. ...
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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,...
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...
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,...

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.