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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|