Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using Recordset.Find And Not Finding the record

Status
Not open for further replies.

ericpsu32

Programmer
Sep 15, 2003
47
0
0
US
Good Afternoon, I have a head scratcher on my hands. I am running a procedure to update a field on a form whose data is derived from a stored procedure with variables. I can successfully get this procedure to run, but it would reset the form on my Me.Requery. My attempt in the code below was to keep the user on the record they updated. Now comes the head scratcher. When I step through this code one line at a time, I get the desired result, yet when I simply run it without the pausing it, I get thrown to the top of the page again??? Any help is appreciated!

[Code/]
Private Sub Apprv_Click()
Dim ocmd As New Command
Dim strSQL As String



strSQL = "[dbo].[sp_CommissionsApproveSingle] '" & Me.pkey & "'"
Set ocmd.ActiveConnection = CurrentProject.Connection
ocmd.CommandText = strSQL
ocmd.Execute

Dim sPkey As String
sPkey = Me.pkey

Dim rs As Object

Set rs = Me.RecordsetClone

Me.Requery

rs.MoveFirst
rs.Find "[pkey] = '" & sPkey & "'"
Me.Bookmark = rs.Bookmark

[/Code]
 
It sounds like another event is being fired, do you have code in the Activate event or something else?


"I'm living so far beyond my income that we may almost be said to be living apart
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top