R
Rob M.
Beneath you will find a piece of VBA-coding from an Access97 database, which
has always been working correctly. When I make a copy of this piece of coding
into a new database (Access97), the code doesn't work anymore (no records
found). Apparantly, MySet isn't recognized anymore ("MySet = nothing"). Can
anybody help me ?
Sub Convocatie()
On Error Resume Next
Dim I As Integer
Dim MySQL As String
Dim MyDB As Database
Dim MySet As Recordset
Set MyDB = DBEngine.Workspaces(0).Databases(0)
MySQL = "SELECT DISTINCT Soort FROM Dossiers WHERE Rnummer = '7654'"
Set MySet = MyDB.OpenRecordset(MySQL)
MySet.MoveLast
MySet.MoveFirst
I = MySet.RecordCount
MsgBox I
End Sub
has always been working correctly. When I make a copy of this piece of coding
into a new database (Access97), the code doesn't work anymore (no records
found). Apparantly, MySet isn't recognized anymore ("MySet = nothing"). Can
anybody help me ?
Sub Convocatie()
On Error Resume Next
Dim I As Integer
Dim MySQL As String
Dim MyDB As Database
Dim MySet As Recordset
Set MyDB = DBEngine.Workspaces(0).Databases(0)
MySQL = "SELECT DISTINCT Soort FROM Dossiers WHERE Rnummer = '7654'"
Set MySet = MyDB.OpenRecordset(MySQL)
MySet.MoveLast
MySet.MoveFirst
I = MySet.RecordCount
MsgBox I
End Sub