Too Many arguments

  • Thread starter charles.kendricks
  • Start date
C

charles.kendricks

I have a report that prints our meal lists for my organization. I
created the database in access 2003. When the database was moved to a
system running MS Office 2000, suddenly this particular report will
not print out the reports. I get an error which complains about the
number of arguments to OpenReport. Here is the code for the report:

Public Sub OpenMealLists()
Dim intAns As Integer
Dim strAnsDate As String
Dim dteDate As Date


intAns = MsgBox("Is This Dining List For Today ?", 36, "Date of
Report")
If intAns = 7 Then
strAnsDate = InputBox("Please Enter Date For This Dining
List")
dteDate = CDate(strAnsDate)
Else
strAnsDate = Date
End If
Debug.Print dteDate

DoCmd.OpenReport "rptMealListB", , , , , strAnsDate
DoCmd.OpenReport "rptMealListL", , , , , strAnsDate
DoCmd.OpenReport "rptMealListD", , , , , strAnsDate
End Sub
 
K

Ken Snell \(MVP\)

ACCESS 2000 does not support OpenArgs argument for the OpenReport method.
That feature was added in ACCESS 2002.

You'll need a different way to pass the value to the report for 2000. I
usually write the value to a hidden textbox on the form that will open the
report, and then let the report read the value from the form in its Open
event.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top