A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

print current report



 
 
Thread Tools Display Modes
  #1  
Old May 21st, 2004, 02:56 PM
Lisa
external usenet poster
 
Posts: n/a
Default print current report

Hi friend,

I have a form that is called testing. It include all of
the information about testing such as Problem ID,
processName,.... I put the print button in this form. but
I want print out report that only include all of the
current form's content.

How sould I do?

thank you

lisa
  #2  
Old May 21st, 2004, 03:09 PM
Rick B
external usenet poster
 
Posts: n/a
Default print current report

Something like the following in the ONCLICK event...

Private Sub Print_Button_Click()
If (IsNull([ProblemID])) Then
' If no record selected, stop procedure
Exit Sub
End If
DoCmd.OpenReport "Some Report Name", acViewNormal, "",
"[ProblemID]=Forms![TheNameOFYourForm]![ProblemID]"
End Sub



Hope That Helps.

Rick B




"Lisa" wrote in message
...
Hi friend,

I have a form that is called testing. It include all of
the information about testing such as Problem ID,
processName,.... I put the print button in this form. but
I want print out report that only include all of the
current form's content.

How sould I do?

thank you

lisa


  #3  
Old May 21st, 2004, 03:13 PM
Cheryl Fischer
external usenet poster
 
Posts: n/a
Default print current report

Lisa,

You will need to add a Where Condition to the OpenReport method so that the
report shows only the information for the record displayed on your form. For
example, if your field "ProblemID" uniquely identifies the record, you
could use it to determine the where condition as follows:

Dim strCriteria As String

' This works when your ProblemID field is text
strCriteria = "[ProblemID] = " & Chr(34) & Me!ProblemID & Chr(34)
DoCmd.OpenReport "MyReport", acViewNormal, , strCriteria

' This works when your ProblemID field is a number
strCriteria = "[ProblemID] = " & Me!ProblemID
DoCmd.OpenReport "MyReport", acViewNormal, , strCriteria

hth,



--

Cheryl Fischer, MVP Microsoft Access



"Lisa" wrote in message
...
Hi friend,

I have a form that is called testing. It include all of
the information about testing such as Problem ID,
processName,.... I put the print button in this form. but
I want print out report that only include all of the
current form's content.

How sould I do?

thank you

lisa



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 10:01 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.