Link to home
Start Free TrialLog in
Avatar of Saleve
SaleveFlag for Switzerland

asked on

Not a valid bookmark error

Hello,
I have created recordset RecipesRS and would like to bookmark the record previous to the one showing on the unbound form:
Dim varBookmark As Variant
Set RecipesRS = db.OpenRecordset("SELECT " & strTableName & ".* FROM " & strTableName & " ORDER BY " & strTableName & ".txtCourse;", dbOpenDynaset)
'The user can scrolll through the recordset in a form.
****************
'This is the part that doesn't work:
RecipesRS.MovePrevious
varBookmark = RecipesRS.Bookmark

I get run-time error '3159': Not a valid bookmark.
Does anyone know what I'm doing wrong?
Thank you.
Saleve
SOLUTION
Avatar of tbsgadi
tbsgadi
Flag of Israel image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Saleve,


Or Alternatively maybe Dim varBookmark as object

Gary
SOLUTION
Avatar of peter57r
peter57r
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Saleve

ASKER

Hello everyone and thank you for your input.  I will be away for a few days and will look at this as soon as I get back.  I apologize in advance for the delay in assigning points.
Saleve
Avatar of Saleve

ASKER

My sincere apologies for the delay.  Ive been out of town&  Thank you for your answers and patience!
Avatar of Saleve

ASKER

I actually have code to fill in the fields on the form, as well as to deal with the first record, but thanks for the input.  The accepted solution works for the second record in the recordset ONLY, so I guess my problems go deeper than just this issue....