RecordSet Bookmark Property

S

scott

I've used CODE 1 below on the "AfterUpdate" event on a combo box to jump to
the record selected fine using Access.

However, after converting my Access file to an ADP file, I get the error
"Object doesn't support this property or method".

Is there an alternative way via VBA to make my combo "AfterUpdate" event
find the choosen record?

The underlying recordset is a stored procedure if that matters. Also, I
tried using CODE 2 without success.


CODE 1 ********

Dim rs As Object

Set rs = Me.Recordset.Clone
rs.Findfirst "[userID] = " & Str(Me![cmbNameQuickFind])
Me.Bookmark = rs.Bookmark



CODE 2 ********

Me.RecordsetClone.Findfirst "[userID] = " & Me![cmbNameQuickFind]
Me.Bookmark = Me.RecordsetClone.Bookmark
 
T

tina

well, i don't know if it would work in ADP, but i usually use the following
in a control's AfterUpdate event to find a record in a form, as

Me.Recordset.FindFirst "somefield = " & Me!findcontrol
If Not Me.Recordset.NoMatch Then Me!somecontrol.SetFocus

hth
 
S

scott

I still get the error "Object doesn't support this property or method".

I've found that ADO doesn't support the "FindFirst" method, it uses the
"Find" method, but I can't find any examples that have a SPROC for the
form's recordsource.

I'm dead-in-the-water with this one. For this to be such almost a necessity
for any form with lots of records, there must be a way.


tina said:
well, i don't know if it would work in ADP, but i usually use the
following
in a control's AfterUpdate event to find a record in a form, as

Me.Recordset.FindFirst "somefield = " & Me!findcontrol
If Not Me.Recordset.NoMatch Then Me!somecontrol.SetFocus

hth


scott said:
I've used CODE 1 below on the "AfterUpdate" event on a combo box to jump to
the record selected fine using Access.

However, after converting my Access file to an ADP file, I get the error
"Object doesn't support this property or method".

Is there an alternative way via VBA to make my combo "AfterUpdate" event
find the choosen record?

The underlying recordset is a stored procedure if that matters. Also, I
tried using CODE 2 without success.


CODE 1 ********

Dim rs As Object

Set rs = Me.Recordset.Clone
rs.Findfirst "[userID] = " & Str(Me![cmbNameQuickFind])
Me.Bookmark = rs.Bookmark



CODE 2 ********

Me.RecordsetClone.Findfirst "[userID] = " & Me![cmbNameQuickFind]
Me.Bookmark = Me.RecordsetClone.Bookmark
 
S

scott

the solution was to use find method below.

Dim rs As Object

Set rs = Me.RecordsetClone

rs.Find "userID=" & Me.cmbNameQuickFind.Value

If Not rs.EOF Then
Me.Bookmark = rs.Bookmark
End If


tina said:
well, i don't know if it would work in ADP, but i usually use the
following
in a control's AfterUpdate event to find a record in a form, as

Me.Recordset.FindFirst "somefield = " & Me!findcontrol
If Not Me.Recordset.NoMatch Then Me!somecontrol.SetFocus

hth


scott said:
I've used CODE 1 below on the "AfterUpdate" event on a combo box to jump to
the record selected fine using Access.

However, after converting my Access file to an ADP file, I get the error
"Object doesn't support this property or method".

Is there an alternative way via VBA to make my combo "AfterUpdate" event
find the choosen record?

The underlying recordset is a stored procedure if that matters. Also, I
tried using CODE 2 without success.


CODE 1 ********

Dim rs As Object

Set rs = Me.Recordset.Clone
rs.Findfirst "[userID] = " & Str(Me![cmbNameQuickFind])
Me.Bookmark = rs.Bookmark



CODE 2 ********

Me.RecordsetClone.Findfirst "[userID] = " & Me![cmbNameQuickFind]
Me.Bookmark = Me.RecordsetClone.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

Similar Threads

Combo Box recordset problem 2
Search combo box 2
cbo AfterUpdate question 5
OnLoad event criteria 4
Goto Record Combo Box Problem 3
Recordset Clone using Autonumber 3
Error 2147352567 2
recordset.clone 13

Top