L
Lisa B.
Can anyone tell me why I get a type mismatch (error 13) when I run the
following code in Access 2000 and How to fix it
The same code works when run in access 97
The error occures at the line : Set SourceRS = TheDB.OpenRecordset(..)
___________________________________
Public Function CheckRequired(FieldName As String) As Boolean
'Check to see if field is Required
Dim TheDB As Database
Dim SourceRS As Recordset
Set TheDB = CurrentDb
Set SourceRS = TheDB.OpenRecordset("tblRequiredFields", dbOpenDynaset)
If SourceRS.RecordCount Then
SourceRS.MoveFirst
Do Until SourceRS.EOF
If SourceRS!FieldName = FieldName Then
CheckRequired = True
End If
SourceRS.MoveNext
Loop
End If
SourceRS.Close
End Function
_________________________________
Any suggestions are greatly appreciated
following code in Access 2000 and How to fix it
The same code works when run in access 97
The error occures at the line : Set SourceRS = TheDB.OpenRecordset(..)
___________________________________
Public Function CheckRequired(FieldName As String) As Boolean
'Check to see if field is Required
Dim TheDB As Database
Dim SourceRS As Recordset
Set TheDB = CurrentDb
Set SourceRS = TheDB.OpenRecordset("tblRequiredFields", dbOpenDynaset)
If SourceRS.RecordCount Then
SourceRS.MoveFirst
Do Until SourceRS.EOF
If SourceRS!FieldName = FieldName Then
CheckRequired = True
End If
SourceRS.MoveNext
Loop
End If
SourceRS.Close
End Function
_________________________________
Any suggestions are greatly appreciated