|
-
Jun 19th, 2008, 07:15 AM
#1
Thread Starter
New Member
VB code producing an error
Hi,
I'm working on the following code: -
Code:
Dim test As Database
Dim Rs As DAO.Recordset
Dim Msg As String
Dim bFlag As Boolean
Set Rs = CurrentDb.OpenRecordset("query", dbOpenStatic, dbReadOnly, dbOptimisticValue)
...
But I'm having trouble as it returns the Run Time error 3001 "Invalid Argument", the line of code that it doesn't like is -
Code:
Set Rs = CurrentDb.OpenRecordset("query", dbOpenDynaset, dbAppendOnly, dbOptimisticValue)
Can anyone help with a way to solve this error please? Or a way around it without using OpenRecordset?
I've been stuck trying to solve this error for 3 days now!
Thanks
Last edited by Wildster; Jun 25th, 2008 at 03:42 AM.
-
Jun 19th, 2008, 07:55 AM
#2
Re: VB code producing an error
Try without the last argument:
Code:
Set Rs = CurrentDb.OpenRecordset("query", dbOpenStatic, dbReadOnly)
-
Jun 19th, 2008, 08:15 AM
#3
Thread Starter
New Member
Re: VB code producing an error
Thanks for the response, I've tried it but it still produces the same error. Cant see why at all. Is there anything else you can think of?
Thanks
-
Jun 19th, 2008, 08:17 AM
#4
Re: VB code producing an error
How about this:
Code:
Set Rs = CurrentDb.OpenRecordset("query", dbOpenDynaset)
-
Jun 19th, 2008, 08:20 AM
#5
Thread Starter
New Member
Re: VB code producing an error
Too few parameters: Expected 3 is the error I now get, so it needs 3 parts to the argument
-
Jun 19th, 2008, 08:29 AM
#6
Re: VB code producing an error
What is "query"?
That error comes from the "query".
-
Jun 19th, 2008, 08:42 AM
#7
Thread Starter
New Member
Re: VB code producing an error
Sorted it, it was the references!! Thanks for the help guys
Last edited by Wildster; Jun 25th, 2008 at 03:41 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|