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  

Need Help with Report



 
 
Thread Tools Display Modes
  #1  
Old July 17th, 2007, 04:46 PM posted to microsoft.public.access.reports
totallyconfused
external usenet poster
 
Posts: 304
Default Need Help with Report

I have a main from and subform. Main form looks up a doctor and the subform
lists the doctor's patients. On the main form there are command buttons to
print specific report for these patients. However, when I click on report
the report comes up with only 4 out of the 5 paitients. It does not pick up
the first patient. Everything else works fine except that one. This is my
code for the report. I do have requery in my main form. Even after I
requery, it will no show all 5 patients. I would appreciate any help anyone
can give me with this. Thank you.

Private Sub ADOLVC_Click()
On Error GoTo Err_ADOLVC_Click

Dim stDocName As String

stDocName = "rpt ADOLVC"
DoCmd.OpenReport "rpt ADOLVC", acPreview, , "[PR ID]=" & Me![PR ID]

Exit_ADOLVC_Click:
Exit Sub

Err_ADOLVC_Click:
MsgBox Err.Description
Resume Exit_ADOLVC_Click

End Sub
  #2  
Old July 17th, 2007, 05:08 PM posted to microsoft.public.access.reports
Duane Hookom
external usenet poster
 
Posts: 7,177
Default Need Help with Report

I'm not sure what PR ID is... Is this the doctor? What happens if you open
your report in design view and find the record source. View the design view
of your record source and set the criteria under the [PR ID] field to the
actual number.

Your code assumes PR ID is numeric. Is this true?

--
Duane Hookom
Microsoft Access MVP


"TotallyConfused" wrote:

I have a main from and subform. Main form looks up a doctor and the subform
lists the doctor's patients. On the main form there are command buttons to
print specific report for these patients. However, when I click on report
the report comes up with only 4 out of the 5 paitients. It does not pick up
the first patient. Everything else works fine except that one. This is my
code for the report. I do have requery in my main form. Even after I
requery, it will no show all 5 patients. I would appreciate any help anyone
can give me with this. Thank you.

Private Sub ADOLVC_Click()
On Error GoTo Err_ADOLVC_Click

Dim stDocName As String

stDocName = "rpt ADOLVC"
DoCmd.OpenReport "rpt ADOLVC", acPreview, , "[PR ID]=" & Me![PR ID]

Exit_ADOLVC_Click:
Exit Sub

Err_ADOLVC_Click:
MsgBox Err.Description
Resume Exit_ADOLVC_Click

End Sub

  #3  
Old July 17th, 2007, 06:32 PM posted to microsoft.public.access.reports
totallyconfused
external usenet poster
 
Posts: 304
Default Need Help with Report

Yes, "PR ID", was referring to Doc ID. Working now. Thank you very much.

"Duane Hookom" wrote:

I'm not sure what PR ID is... Is this the doctor? What happens if you open
your report in design view and find the record source. View the design view
of your record source and set the criteria under the [PR ID] field to the
actual number.

Your code assumes PR ID is numeric. Is this true?

--
Duane Hookom
Microsoft Access MVP


"TotallyConfused" wrote:

I have a main from and subform. Main form looks up a doctor and the subform
lists the doctor's patients. On the main form there are command buttons to
print specific report for these patients. However, when I click on report
the report comes up with only 4 out of the 5 paitients. It does not pick up
the first patient. Everything else works fine except that one. This is my
code for the report. I do have requery in my main form. Even after I
requery, it will no show all 5 patients. I would appreciate any help anyone
can give me with this. Thank you.

Private Sub ADOLVC_Click()
On Error GoTo Err_ADOLVC_Click

Dim stDocName As String

stDocName = "rpt ADOLVC"
DoCmd.OpenReport "rpt ADOLVC", acPreview, , "[PR ID]=" & Me![PR ID]

Exit_ADOLVC_Click:
Exit Sub

Err_ADOLVC_Click:
MsgBox Err.Description
Resume Exit_ADOLVC_Click

End Sub

 




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 12:37 AM.


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