B
Bill
In my OnOpen code (Below), I get a Run-time
error '3061': Too few parameters. Expected 1.
on the "Set rs" statement. (The strSQL string
is correct.) The statement itself was a suggestion
from Allen Browne in response to my post:
"RecordsetClone equivalent for Reports" from
Tuesday, 8/8. (See that thread for details) I
didn't get the chance to ask Allen about the
notation "(0)(0)", (which I don't see anywhere
in 2003 HELP), so I don't know if that has
anything to do with the error or not.
What's the problem?
Bill
==========(Begin Code)============
Private Sub Report_Open(Cancel As Integer)
Dim strTemp() As String
Dim rs As DAO.Recordset
Dim strSQL As String
strTemp = Split(Me.OpenArgs, ";")
strRetDate = strTemp(0)
strPayTo = strTemp(1)
lngSendID = strTemp(2)
strAmt = strTemp(3)
strRecBy = strTemp(4)
strRegards = strTemp(5)
strSQL = "SELECT * FROM QAsilomar WHERE RegistryID = " & lngSendID & ";"
Set rs = DBEngine(0)(0).OpenRecordset(strSQL) <<<<<<<<<ERROR HERE
With rs
If .RecordCount > 0 Then
strFname = Nz(!FIRSTNAME, vbNullString)
strLname = Nz(!LASTNAME, vbNullString)
strAdr = Nz(![ADDRESS], vbNullString)
strCS = Nz(![CITYSTATE], vbNullString)
strZip = Nz(![ZIP], vbNullString)
strHomeNo = Nz(![HOMEPHONE], vbNullString)
strWorkNo = Nz(![WORKPHONE], vbNullString)
strCellNo = Nz(![CELLPHONE], vbNullString)
End If
End With
rs.Close
Set rs = Nothing
End Sub
==============(End Code)=================
error '3061': Too few parameters. Expected 1.
on the "Set rs" statement. (The strSQL string
is correct.) The statement itself was a suggestion
from Allen Browne in response to my post:
"RecordsetClone equivalent for Reports" from
Tuesday, 8/8. (See that thread for details) I
didn't get the chance to ask Allen about the
notation "(0)(0)", (which I don't see anywhere
in 2003 HELP), so I don't know if that has
anything to do with the error or not.
What's the problem?
Bill
==========(Begin Code)============
Private Sub Report_Open(Cancel As Integer)
Dim strTemp() As String
Dim rs As DAO.Recordset
Dim strSQL As String
strTemp = Split(Me.OpenArgs, ";")
strRetDate = strTemp(0)
strPayTo = strTemp(1)
lngSendID = strTemp(2)
strAmt = strTemp(3)
strRecBy = strTemp(4)
strRegards = strTemp(5)
strSQL = "SELECT * FROM QAsilomar WHERE RegistryID = " & lngSendID & ";"
Set rs = DBEngine(0)(0).OpenRecordset(strSQL) <<<<<<<<<ERROR HERE
With rs
If .RecordCount > 0 Then
strFname = Nz(!FIRSTNAME, vbNullString)
strLname = Nz(!LASTNAME, vbNullString)
strAdr = Nz(![ADDRESS], vbNullString)
strCS = Nz(![CITYSTATE], vbNullString)
strZip = Nz(![ZIP], vbNullString)
strHomeNo = Nz(![HOMEPHONE], vbNullString)
strWorkNo = Nz(![WORKPHONE], vbNullString)
strCellNo = Nz(![CELLPHONE], vbNullString)
End If
End With
rs.Close
Set rs = Nothing
End Sub
==============(End Code)=================