ADO Export to Excel, Error on rs.Open

Domski74

Registered User.
Local time
Today, 06:04
Joined
Jan 29, 2009
Messages
18
Hi there,

I put together a subroutine that uses an ado recordset based on an existing query, it's worked before but doesn't work in my current query?

The code is as follows:

Code:
   ...
    
   
'BUILD RECORDSET
    With rst
        .ActiveConnection = CurrentProject.Connection
        .Source = "SELECT * FROM [" & QueryName & "]"
        .CursorLocation = adUseServer
        .CursorType = adOpenStatic
        .LockType = adLockReadOnly
        .Open
    End With

...

The query has criteria on a date field that picks up a date from my form and uses DateSerial(forms!myform!cboYear,forms!myform!cboMonth,forms!myform!cboDay) as the criteria.

The error occurs right at the beginning when I try to open the recordset I get the error "No value given for one or more required parameters" ?

Any help would be much appreciated!

Many thanks.
 
Last edited:

Users who are viewing this thread

Back
Top Bottom