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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|