Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

One report working, one not

Status
Not open for further replies.

missinglinq

Programmer
Feb 9, 2002
1,914
US
I have two reports based on a single Select Query. From a form the "Cut Off Date" and "Technician's Intials" are selected. A Comman Button then runs two reports.

The first report lists, for the Technician selected, each client due a visit on or before the "Cut Off Date." This report is running correctly, listing each client that matchs both criteria.

The second report is supposed to print out a "Visit Sheet" for each of the above clients. Currently, it is only doing this for a single client.

Does anyone have an idea what I'm missing?

Thanks in advance for any help.

The Missinglinq

There's ALWAYS more than one way to skin a cat!
 
missinglinq
Can you post the DoCmd line that runs the two reports?

Tom
 
Thanks fore your interest, Tom! Here's the code:

Private Sub VisitReports_Click()
On Error GoTo Err_VisitReports_Click

Dim stDocName As String
Dim Msg As String
'Check that there is at least 1 record returned by query
intX = DCount("[PtName]", "CallSheetQuery")
If intX > 0 Then
'Print listing of visits due
stDocName = "Callsheet"
DoCmd.OpenReport stDocName, acViewNormal

'Print individual visit sheets
stDocName = "VisitReport"
DoCmd.OpenReport stDocName, acViewNormal

Else
'If no records are returned by query
Msg = "THERE ARE NO VISITS DUE FOR THIS TECHNICIAN" +
(Chr(13)) + (Chr(13)) + " DURING THE SELECTED TIME
FRAME!"
MsgBox Msg, vbOKOnly + vbInformation
End If

The Missinglinq

There's ALWAYS more than one way to skin a cat!
 
missinglinq
What happens if you make the second report a subreport of the first report?

Then you would only use the first DoCmd line, but you would get a second report (as a sub) for each primary report.

Tom
 
Tom,

Once again thanks for your interest and time. I finally bit the bullet an hour ago and just re-did the Report (exactly like the original as far as I can tell) and it runs fine! I guess it was just another of those Access Gremlins! They do pop up from time to time with no rhyme or reason!

Thanks again!

The Missinglinq



There's ALWAYS more than one way to skin a cat!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top