G
Guest
Hi,
I don't understand why the following code generates a 'Type mismatch' error:
Dim rs as DAO.recordset
dim varTemp as variant
'(rs opened and moved to a record)
varTemp = rs.Bookmark 'Note a record
'(In later code after moving around recordset)
If rs.Bookmark = varTemp then
'Confirm on tagged record
'Code..........
End If
The line 'If rsBookmark = varTemp Then' gives a type mismatch error with the
'=' highlighted.
The reason I am using this line is because as I am processing through the
recordset, I may need to add some new records. Because these added records
are placed at the end of the rs, I need to know what is the first added
record bookmark, otherwise I will 'reprocess' these added records.
So my alternate question is, is this the best method for handling this
situation? To close and re-open the rs each time is to slow. To add a record
then remove it from the recordset would also work (But not delete it from the
table).
I hope this is clear. I can provide more complete code if needed.
Thanks in advance.
swas
I don't understand why the following code generates a 'Type mismatch' error:
Dim rs as DAO.recordset
dim varTemp as variant
'(rs opened and moved to a record)
varTemp = rs.Bookmark 'Note a record
'(In later code after moving around recordset)
If rs.Bookmark = varTemp then
'Confirm on tagged record
'Code..........
End If
The line 'If rsBookmark = varTemp Then' gives a type mismatch error with the
'=' highlighted.
The reason I am using this line is because as I am processing through the
recordset, I may need to add some new records. Because these added records
are placed at the end of the rs, I need to know what is the first added
record bookmark, otherwise I will 'reprocess' these added records.
So my alternate question is, is this the best method for handling this
situation? To close and re-open the rs each time is to slow. To add a record
then remove it from the recordset would also work (But not delete it from the
table).
I hope this is clear. I can provide more complete code if needed.
Thanks in advance.
swas