Need help with "Invalid Argument" 
Author Message
 Need help with "Invalid Argument"

I have a report that has been working just fine.  I made
some changes to the query that the report uses and now I
am getting "Run-time error '3001'; Invalid Argument".  I
cannot figure out why.  When I run the query by itself it
has the records that I expect.

Here is part of my code--I get the error on the last line:
In the general declarations:
   Dim dbsReport As DAO.Database
   Dim qdf As DAO.QueryDef
   Dim rstReport As DAO.Recordset

Private Sub Report_Open(Cancel As Integer)
   Dim intX As Integer
   Dim frm As Form

   Set dbsReport = CurrentDb
   Set frm = Forms!frmRptEmployee
   Set qdf = dbsReport.QueryDefs("Employee Report Query")
   qdf.Parameters("Forms!frmRptEmployee!alctnMnthYr") _
     = frm!AlctnMnthYr
   Set rstReport = qdf.OpenRecordset()

Any suggestions as to what could be causing this error or
how to debug this?

Thank you for any help that you can give me,
Judy



Mon, 14 Nov 2005 01:03:15 GMT  
 Need help with "Invalid Argument"
Judy,

In the line

qdf.Parameters("Forms!frmRptEmployee!alctnMnthYr") _
      = frm!AlctnMnthYr

the quoted stringlooks suspicious to me.  What is the name of the parameter
for the query?  If there's only one, you can try:

qdf.Parameters(0) = frm!AlctnMnthYr

HTH,
Kevin


Quote:
> I have a report that has been working just fine.  I made
> some changes to the query that the report uses and now I
> am getting "Run-time error '3001'; Invalid Argument".  I
> cannot figure out why.  When I run the query by itself it
> has the records that I expect.

> Here is part of my code--I get the error on the last line:
> In the general declarations:
>    Dim dbsReport As DAO.Database
>    Dim qdf As DAO.QueryDef
>    Dim rstReport As DAO.Recordset

> Private Sub Report_Open(Cancel As Integer)
>    Dim intX As Integer
>    Dim frm As Form

>    Set dbsReport = CurrentDb
>    Set frm = Forms!frmRptEmployee
>    Set qdf = dbsReport.QueryDefs("Employee Report Query")
>    qdf.Parameters("Forms!frmRptEmployee!alctnMnthYr") _
>      = frm!AlctnMnthYr
>    Set rstReport = qdf.OpenRecordset()

> Any suggestions as to what could be causing this error or
> how to debug this?

> Thank you for any help that you can give me,
> Judy



Mon, 14 Nov 2005 05:49:57 GMT  
 Need help with "Invalid Argument"
Thank you for offering your help.  Unfortunately, this did
not solve my problem.  The report was actually working
until I made changes to the query.  I can see results when
I run the query separately; I am wondering if there is
something in the result set that is causing the problem.  
And I do have to solve this problem somehow.

Thanks,
Judy

Quote:
>-----Original Message-----
>Judy,

>In the line

>qdf.Parameters("Forms!frmRptEmployee!alctnMnthYr") _
>      = frm!AlctnMnthYr

>the quoted stringlooks suspicious to me.  What is the

name of the parameter
Quote:
>for the query?  If there's only one, you can try:

>qdf.Parameters(0) = frm!AlctnMnthYr

>HTH,
>Kevin



>> I have a report that has been working just fine.  I made
>> some changes to the query that the report uses and now I
>> am getting "Run-time error '3001'; Invalid Argument".  I
>> cannot figure out why.  When I run the query by itself
it
>> has the records that I expect.

>> Here is part of my code--I get the error on the last
line:
>> In the general declarations:
>>    Dim dbsReport As DAO.Database
>>    Dim qdf As DAO.QueryDef
>>    Dim rstReport As DAO.Recordset

>> Private Sub Report_Open(Cancel As Integer)
>>    Dim intX As Integer
>>    Dim frm As Form

>>    Set dbsReport = CurrentDb
>>    Set frm = Forms!frmRptEmployee
>>    Set qdf = dbsReport.QueryDefs("Employee Report
Query")
>>    qdf.Parameters("Forms!frmRptEmployee!alctnMnthYr") _
>>      = frm!AlctnMnthYr
>>    Set rstReport = qdf.OpenRecordset()

>> Any suggestions as to what could be causing this error
or
>> how to debug this?

>> Thank you for any help that you can give me,
>> Judy

>.



Mon, 14 Nov 2005 06:12:33 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. "Invalid Argument" Error Message

2. CompactDatabase gives "3001: Invalid Argument"

3. ERROR 3001 - "Invalid Argument"

4. "Invalid Argument" errors

5. compile error "invalid procedure call or argument

6. compile error "invalid procedure call or argument

7. I need help with rdo message "invalid argument" on update method

8. "/decompile" command line argument

9. Passing Arguments through "OnAction"

10. "INVALID DATA FORMAT"

11. "Invalid use of null" error

12. "Operation invalid without current index"

 

 
Powered by phpBB® Forum Software