Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8959507
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T15:27:25+00:00 2026-06-15T15:27:25+00:00

I have a continuous form with a command button in the footer that updates

  • 0

I have a continuous form with a command button in the footer that updates the current record with a value that will make the record no longer show in the form once requeried. I want the user to be able to click the button and once the record is updated, move to the next record, not the first as is the default behaviour. I have code that I would think should work but doesn’t, it keeps going back to the first record on the form.

Private Sub cmdCloseReq_Click()

Dim ReqID As String
ReqID = Me.txtReqID
Dim rst As Recordset
Dim strBookmark As Integer

Set rst = Me.RecordsetClone
rst.MoveNext
If Not rst.EOF Then                 ' if not end-of-file
  strBookmark = rst.Bookmark      ' ...save the next record's bookmark
  Dim cmd As New ADODB.Command
  With cmd
    .ActiveConnection = CurrentProject.Connection
    .CommandType = adCmdStoredProc
    .CommandText = "spUpdateLOG_ReqCompleteDate"
    .Parameters("@ReqID") = ReqID
    .Execute
  End With                 
Me.Requery
Me.Bookmark = strBookmark

End If
Set rst = Nothing   

End Sub

OK, I found a solution based on rene’s post. I grab the next records primary key, do an update then after the requesry I find the next record and set the bookmark to that. Here is the code:

Private Sub cmdCloseReq_Click()

Dim ReqID As String
ReqID = Me.txtReqID
Dim rst As New ADODB.Recordset
Dim strBookmark As String

Set rst = Me.RecordsetClone

With rst
 .Find "[ReqID] = '" & ReqID & "'"
 .MoveNext
 strBookmark = rst.Fields(0)

End With

If Not rst.EOF Then                 ' if not end-of-file
      ' ...save the next record's bookmark

  Dim cmd As New ADODB.Command

  With cmd
    .ActiveConnection = CurrentProject.Connection
    .CommandType = adCmdStoredProc
    .CommandText = "spUpdateLOG_ReqCompleteDate"
    .Parameters("@ReqID") = ReqID
    .Execute
  End With                 ' ...delete the record

  Me.Requery

 Set rst = Me.RecordsetClone
 With rst
      .Find "[reqID]= " & strBookmark
    Me.Bookmark = .Bookmark

End With

Else
  With cmd
    .ActiveConnection = CurrentProject.Connection
    .CommandType = adCmdStoredProc
    .CommandText = "spUpdateLOG_ReqCompleteDate"
    .Parameters("@ReqID") = ReqID
    .Execute
  End With                 ' ...delete the record
Me.Requery

End If
Set rst = Nothing 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T15:27:27+00:00Added an answer on June 15, 2026 at 3:27 pm

    I recall that Bookmarks are invalidated after a Requery. If you have a primary key you can better grab that one and after requery move the current record to the previously obtained primary key

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a button at the end of each record on a continuous form
I have a continuous form that works when I manually open it. However when
I have a continuous form that i would like to populate via a sql
I have an MS Access 2007 subform that is displaying data in continuous form
I have a continuous form that contains a drop down box whos control source
I have a form of view type continuous forms that is returning records based
The problem is I have a continuous form and there's a column that the
I have a Form with a (Continuous) Subform that lists the results of a
I have a 2007 Access form, in continuous format. I added a button to
I have a purchase form that has a continuous subform which shows line items

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.