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

Report from a single record

What I need to have happen is, that when the form is filled out by the user,
the user can produce a report of that record only. Any help would be
appreciated.

Thank you.
William Bradley
Come visit us at:
http://www.catholicmissionleaflets.org
Free Rosaries available at the above.
Nov 13 '05 #1
4 13433
You need a field to uniquely identify the record in the form.
This example assumes it is and autonumber named ID.

Private Sub cmdPrint_Click()
If Me.Dirty Then 'save first
Me.Dirty = False
End If
If Me.NewRecord Then 'Check there is a record to print
MsgBox "Select a record to print."
Else
DoCmd.OpenReport "MyReport", acViewPreview, , "ID = " & Me.ID
End If
End Sub

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"William Bradley" <br******@magma.ca> wrote in message
news:Bb********************@magma.ca...
What I need to have happen is, that when the form is filled out by the user, the user can produce a report of that record only. Any help would be
appreciated.

Nov 13 '05 #2
Allen Browne wrote:

Thank you for the following Allen. Previously I was able to produce a
report, of the current record in the form, which the user was able to
produce from an action button on the form. (Somehow I lost my notes on how
to do this.) Will the following allow me to do the same or will the user
have to select a record?

By the way, just got back a week ago from four weeks in Australia. Had a
grand time.
You need a field to uniquely identify the record in the form.
This example assumes it is and autonumber named ID.

Private Sub cmdPrint_Click()
If Me.Dirty Then 'save first
Me.Dirty = False
End If
If Me.NewRecord Then 'Check there is a record to print
MsgBox "Select a record to print."
Else
DoCmd.OpenReport "MyReport", acViewPreview, , "ID = " & Me.ID
End If
End Sub


--
William Bradley
Come visit us at:
http://www.catholicmissionleaflets.org
Free Rosaries available at the above.
Nov 13 '05 #3
1. Put a command button on your form.

2. Set its On Click property to
[Event Procedure]

3. Click the build button beside the property.
Access opens the code window.

4. Paste the code between the "Private Sub..." and "End Sub" lines.

The code will print the current record in the screen.
It's getting cold now in Aus. Not by Canadian standards though. :-)

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"William Bradley" <br******@magma.ca> wrote in message
news:Dq********************@magma.ca...
Allen Browne wrote:

Thank you for the following Allen. Previously I was able to produce a
report, of the current record in the form, which the user was able to
produce from an action button on the form. (Somehow I lost my notes on how
to do this.) Will the following allow me to do the same or will the user
have to select a record?

By the way, just got back a week ago from four weeks in Australia. Had a
grand time.
You need a field to uniquely identify the record in the form.
This example assumes it is and autonumber named ID.

Private Sub cmdPrint_Click()
If Me.Dirty Then 'save first
Me.Dirty = False
End If
If Me.NewRecord Then 'Check there is a record to print
MsgBox "Select a record to print."
Else
DoCmd.OpenReport "MyReport", acViewPreview, , "ID = " & Me.ID
End If
End Sub

Nov 13 '05 #4
Allen Browne wrote:

Thank you Allen, I will follow up when I go back to the office next.

It was cool in Melbourne, but only had two days of rain. I think they would
like to have a week or more of rain.
1. Put a command button on your form.

2. Set its On Click property to
[Event Procedure]

3. Click the build button beside the property.
Access opens the code window.

4. Paste the code between the "Private Sub..." and "End Sub" lines.

The code will print the current record in the screen.
It's getting cold now in Aus. Not by Canadian standards though. :-)


--
William Bradley
Come visit us at:
http://www.catholicmissionleaflets.org
Free Rosaries available at the above.
Nov 13 '05 #5

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

Similar topics

0
by: William Bradley | last post by:
On the form which contains the record, I can print a single report from that form. What I would like to do now is do the same thing but select the report from any one of a dozen choices of report....
2
by: Bob Quintal | last post by:
I have a report that prints a single record. Normally it's enter one record, then print it. This works great. New requirement: Each record needs to be printed to an individual ..pdf file from...
2
by: Tom | last post by:
I have a report where one field tends to be rather lengthly and ends up being several lines long while another field has several short entries. The problem I have is that the first of the short...
3
by: RWC | last post by:
Hello, I have an issue that's driving me batty! I have a report, whose record source is SQL based on a normalized set of tables. There are no nested queries and no dlookups in this record...
4
by: Mal | last post by:
I have an ACC 2000 database that has a strange behaviour I have a small table, with just a few fields... My report has very simple grouping and sorting, no code bar a NODATA event. I have a...
9
by: MLH | last post by:
I have a source query (qryITSLetterList) feeding rows containing name, addr, city, state, zip and VehicleID to a report (rptITSnotices). The query may contain 1-to-5 records resulting in 1-to-5...
0
by: willemp | last post by:
i have a report with a 3 groups in it A - project B - person each record in the report consists of a single realised workday on a single project by a single person. so i have records that...
0
by: willemp | last post by:
i have a report with a 3 groups in it A - project B - person each record in the report consists of a single realised workday on a single project by a single person.
4
by: magmike | last post by:
I've created a report for the purpose of printing a one page summary of a record. Of course, when I created the report, it gives me a page on every record. Can I create a button to open that report...
0
by: AmateurDBer | last post by:
Hello, I'm looking for Allen. I hate to bother you again, but I am now trying to e-mail the single record from the same form mentioned before (using a macro button) (reference thread about...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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?
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
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
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
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.