Quote:
Originally Posted by Lokerin
-
sub
-
DoCmd.OpenReport "Report A", acNormal, , "[Medical Record #]=" & Medicalrec & " AND [Arrival time]=" & AT _
-
& " AND [Date Assessment Completed]=" & "#" & DAC & "#"
-
-
DoCmd.OpenReport "Report b", acnormal, , "[Medical Record #]=" & Medicalrec & " AND [Arrival time]=" & AT _
-
& " AND [Date Assessment Completed]=" & "#" & DAC & "#"
-
end sub
-
...the problum is that when it moves to the next report it askes for the information in the form of a input box not from the specifiyed fields
Hi Lokerin. Since the two calls to OpenReport are identical other than the report title, it suggests there might be field differences in the two reports. OpenReport will pop up a parameter box for the user to fill in any missing fields, so note down the name of the field or fields you are asked for, then check that report B includes all of the same fields with the same titles as report A. The recordsource does not have to be the same for both reports, although if it is this will make tracking down your error a bit easier, but at the very least the fields [Medical Record #], [Arrival Time] and [Date Assessment Completed] must be present in Report B for the OpenReport call as listed to work correctly.
(I added code tags to the extract from your post above to make it clearer to read.)
-Stewart