"BOOKMARK" problem, Please someone Help!

R

Robert

The fragment of code below generates the following error:
"Runtime error 3159 , Not a valid bookmark"

A recordset in ADO has been declared and followed by this
next code fragment and error happens on the second line.
Rest assure that "strSQL" containes a valid criteria.

rst1Util.Find strSQL
frmAny1.Bookmark = rst1Util.Bookmark

Anyone?

Regards,

Robert
 
P

PC Datasheet

You need:
Forms!frmAny1.Bookmark = rst1Util.Bookmark
or
Me.Bookmark = rst1Util.Bookmark
 
R

Robert

I really appreciate your help, however:

Forms![frm_ClientTypes].Bookmark = rst1Util.Bookmark
WORKS!

However my form name must be a variable, thus frmAny1 is
a form object and:
Forms![frmAny1].Bookmark = rst1Util.Bookmark
or
Forms![frmAny1.Name].Bookmark = rst1Util.Bookmark
Doesn't work! I believe that there must be something else
to do in this case since ayt this point of my program I
am in a VBA code procedure.

If you're still there, would you have any other ideas!
Thanking you in advance.

Robert.
 
P

PC Datasheet

Sorry, I didn't know frmAny1 was a form object!

Try this;
Dim FrmAny1 As Form
Set FrmAny1 = Forms("frm_ClientTypes")
FrmAny1.Bookmark = rst1Util.Bookmark


--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
(e-mail address removed)
www.pcdatasheet.com

Robert said:
I really appreciate your help, however:

Forms![frm_ClientTypes].Bookmark = rst1Util.Bookmark
WORKS!

However my form name must be a variable, thus frmAny1 is
a form object and:
Forms![frmAny1].Bookmark = rst1Util.Bookmark
or
Forms![frmAny1.Name].Bookmark = rst1Util.Bookmark
Doesn't work! I believe that there must be something else
to do in this case since ayt this point of my program I
am in a VBA code procedure.

If you're still there, would you have any other ideas!
Thanking you in advance.

Robert.





-----Original Message-----
You need:
Forms!frmAny1.Bookmark = rst1Util.Bookmark
or
Me.Bookmark = rst1Util.Bookmark


--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
(e-mail address removed)
www.pcdatasheet.com





.
 
V

Van T. Dinh

If frmAny1 is a Form Object Variable, you can simply use:

frmAny1.Bookmark = rst1Util.Bookmark

If frmAny1 is a String variable that holds the name of the required Form,
try:

Forms(frmAny1).Bookmark = rst1Util.Bookmark
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top