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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Invalid procedure call or argument

Status
Not open for further replies.

HomeGrowth

Technical User
Aug 19, 2004
76
US
all of suddenly, I got this error 'Invalid procedure call or argument' when I click on a few preview button on reports. The preview button codes are just the standard codes setup with the wizard, and I added the stFilter.


Private Sub cmdPreviewRpt_Click()
On Error GoTo Err_cmdPreviewRpt_Click

Dim stDocName As String
Dim stFilter As String
Dim strOption As String

strOption = Me.optTypeOfRecords

Select Case strOption
Case Is = 1
stFilter = "[StabilityDocStatus] Like 'Active/Approved'"
Case Is = 2
stFilter = "[StabilityDocStatus] Like 'Inactive*'"
Case Is = 3
stFilter = ""
End Select

stDocName = "rpt_StabilityProtocol_rpt"
DoCmd.OpenReport stDocName, acViewPreview, , stFilter

Exit_cmdPreviewRpt_Click:
Exit Sub

Err_cmdPreviewRpt_Click:
MsgBox Err.Description
Resume Exit_cmdPreviewRpt_Click

End Sub



I check the references, they are in this order:
Visual Basic For Application
Microsoft Access 11.0 Object Library
OLE Automation
Microsoft DAP 3.6 Object Library
Microsoft ActiveX Data Object 2.1 Library


My Laptop that I used to develop the program works without error. Any suggestion what else need to check? Thank you.

HG
 
The error has the 'OK' button, it has no 'debug' button to show which line. We had the SP3 with Access 2003 on both computers.
 
Comment out your "On Error" statement so that the program stops on the line that is raising the error rather than jumping to the error label.

... and use [ignore]
Code:
 ...
tags instead of [red] ... [/red] tags.[/ignore]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top