Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

recordset error Please HELP!!!

Status
Not open for further replies.

mk2lee1

MIS
Jul 8, 2003
51
US
I now have changed my code this this
but I get type mismatch error at

Set rst = db.OpenRecordset(SQL)

Any idea?
==========================================
Private Sub Form_Load()

Dim db As Database
Dim rst As Recordset
Dim i As Integer

Dim SQL As String
SQL = "SELECT [school].[schoolName], [Participation].[ParticipationID], [Participation].[TestDAte]" & _
"FROM school RIGHT JOIN Participation ON [Participation].[SchoolID]=[School].[SchooliD]" & _
&quot;WHERE ([Participation].[testDate]-date()<=30 And [Participation].[testDate]-date()>0)&quot;

Set db = CurrentDb
Set rst = db.OpenRecordset(SQL)

If rst.RecordCount <> 0 Then
rst.MoveLast
rst.MoveFirst

For i = 0 To rst.RecordCount
variable = rst.Fields(i)
rst.MoveNext
Next i
End If

 
Looks like you are in Access ??
You might need to add the reference : Microsoft DAO 3.6 object library for example (Tools/References) to your project.
 
I added it.. but I still have same error message..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top