temporary queries

littlelegs

Registered User.
Local time
Today, 09:16
Joined
May 8, 2002
Messages
10
Hope someone here can help me...

I keep getting run-time error '3061 - Too few parameters, expected one' on the 'Set class_rst = ' line of the following sub:

Sub Get_horse_recs(class_rst, class)

sql_string = ""
RIDER_F = query_rst(0)
RIDER_L = query_rst(1)

l1 = "SELECT * "
l2 = "FROM [RIDSCORE]"
l3 = " WHERE ((([RIDSCORE].RIDER_L) = """ & RIDER_L & """) And (([RIDSCORE].RIDER_F) = """ & RIDER_F & """) And (([RIDSCORE].LEVEL) = """ & class & """))"
l4 = " ORDER BY [RIDSCORE].YEAR DESC;"
sql_string = l1 & l2 & l3 & l4

Set tempa_qdef = xdb.CreateQueryDef("", sql_string)

Set class_rst = tempa_qdef.OpenRecordset(dbOpenDynaset) 'get the records for each rider via a query


End Sub

One of the calls to the sub:

Get_horse_recs classb_rst, b


And the declarations:

Dim class_rst As DAO.Recordset
Dim tempa_qdef As DAO.QueryDef
Dim sql_string As String
Dim l1 As String
Dim l2 As String
Dim l3 As String
Dim l4 As String

I am using 22 different called queries that list a number of people, then use this sub to fetch all records for one rider at one level (ie all recs for Joe Smith at B1). So the queries are temps for getting records for each rider from the main table.

The stupid thing is.... the whole thing did work... now it doesn't.

[This message has been edited by littlelegs (edited 05-08-2002).]
 

Users who are viewing this thread

Back
Top Bottom