Results 1 to 3 of 3
  1. #1
    aquaraider is offline Novice
    Windows XP Access 2003
    Join Date
    Sep 2009
    Posts
    14

    Question How to make a form show a partiular record when open it?

    Oh it has length limitation for the title, what I actually want to ask is,

    How to make a form show a partiular record when open it? But I can still navigate to other records?
    Just like a book, I can open it to Page 3 but I can still go to Page 4 later.

    Here is my code:

    Private Sub EditOrder_Click()
    On Error GoTo Err_EditOrder_Click
    Dim stDocName As String


    Dim stLinkCriteria As String
    stDocName = "Edit Order"

    stLinkCriteria = "[OrderID]=" & Me![OrderID]
    DoCmd.OpenForm stDocName, , , stLinkCriteria, acFormEdit
    DoCmd.Close acForm, "Orders"
    Exit_EditOrder_Click:
    Exit Sub
    Err_EditOrder_Click:
    MsgBox Err.Description
    Resume Exit_EditOrder_Click
    End Sub
    It's a button on "Orders" form, when I click on it ,it will open "Edit Order" with the same record shown on "Orders" form.

    but "Edit Order" form now has a (Filtered) on the bottom near Navigation Buttons, which makes it will only shows that single record and I cannot navigate to others.

    Does anyone would like to tell me how to make navigation button works without impact on any other funtions? (eg. I don't want to refresh the form if it makes the form jumps back to the 1st record, I just want to navigate it from X's record to X+1 or X-1's record)

    Sorry for my poor English, and thanks very much.
    Last edited by aquaraider; 09-24-2009 at 08:08 AM.

  2. #2
    SoftwareMatters is offline Access VBA Developers
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2009
    Location
    Dorset
    Posts
    274
    Hi,
    Try this (haven't tested it but the principle seems right!):
    stDocName = "Edit Order"
    DoCmd.OpenForm stDocName
    With Forms![Edit Order]!.Form.RecordsetClone
    .FindFirst "[OrderID]=" & Me![OrderID]
    If Not .NoMatch Then Forms!Edit Order!.Form.Bookmark = .Bookmark
    End With

  3. #3
    aquaraider is offline Novice
    Windows XP Access 2003
    Join Date
    Sep 2009
    Posts
    14

    Smile

    Quote Originally Posted by SoftwareMatters View Post
    Hi,
    Try this (haven't tested it but the principle seems right!):
    stDocName = "Edit Order"
    DoCmd.OpenForm stDocName
    With Forms![Edit Order]!.Form.RecordsetClone
    .FindFirst "[OrderID]=" & Me![OrderID]
    If Not .NoMatch Then Forms![Edit Order]!.Form.Bookmark = .Bookmark
    End With
    Thank you very much for help, I've made some changes on the code, it works perfect now.:-)

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 3
    Last Post: 06-27-2009, 03:53 PM
  2. Replies: 1
    Last Post: 05-16-2009, 08:47 AM
  3. Replies: 9
    Last Post: 03-24-2009, 09:19 PM
  4. Replies: 4
    Last Post: 03-24-2009, 09:07 PM
  5. Show a new image per record in a form
    By Bert Colourama in forum Forms
    Replies: 0
    Last Post: 09-25-2008, 05:22 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums