Re: Help with: Docmd.OpenReport

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Felicia Fisher (anonymous_at_discussions.microsoft.com)
Date: 02/27/04


Date: Fri, 27 Feb 2004 11:46:08 -0800

I have tried to use a "Where Condition" that uses the Primary Key as criteria, and the DAP just froze up. Upon forcing the DAP to close, there appeared a small dialog box that asked for the Primary Key number of the record that I wanted to print and - It PRINTS! I'd rather print before closing IE...... ARRRRG! This is the script:

DoCmd.OpenReport "ReportName",,acPreview,"ID = " & ID

Next, I tried the following script and nothing happens when you click the print button:

<SCRIPT language=vbscript event=onclick for=Command0>
Dim OneRec As String
DoCmd.RunCommand acCmdSaveRecord
'Saves the record so it is available to print even if it was just created
OneRec="[ID]=" & Me.ID
DoCmd.OpenReport "AssetDisposal",acViewPreview,,OneRec
</SCRIPT>

Should I expect different results because I am trying to do this procedure with a DAP instead of a regular form page?


Quantcast