By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,493 Members | 1,214 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,493 IT Pros & Developers. It's quick & easy.

Where command help

P: 3
ok here is the question i have a code

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

and this code is suposed to print the report based on the information given in the form
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

thanx for taking a look
Mar 11 '08 #1
Share this Question
Share on Google+
1 Reply


Expert Mod 2.5K+
P: 2,545
Expand|Select|Wrap|Line Numbers
  1. sub
  2. DoCmd.OpenReport "Report A", acNormal, , "[Medical Record #]=" & Medicalrec & " AND [Arrival time]=" & AT _
  3. & " AND [Date Assessment Completed]=" & "#" & DAC & "#"
  4.  
  5. DoCmd.OpenReport "Report b", acnormal, , "[Medical Record #]=" & Medicalrec & " AND [Arrival time]=" & AT _
  6. & " AND [Date Assessment Completed]=" & "#" & DAC & "#"
  7. end sub
  8.  
...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
Mar 11 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.