Results 1 to 6 of 6
  1. #1
    Join Date
    Feb 2004
    Location
    New Zealand
    Posts
    1,420
    Provided Answers: 7

    Unanswered: Goto Record in a subform

    i order entry screen (orders)

    which has a 2 subform Purchase order
    1 detail view and other one form table view

    have a toggle button which flicks between them both user happy

    BUT she just ask me when i'm in the table view on record 5
    when I click the toggle back to detail view can it jump to record 5

    "good idea why didn't i think of that "


    so

    what I have done

    Create a

    Code:
    Global CurrentPurshaseOrderRec As Long
    then in the current (event) in the table View
    i put
    Code:
    CurrentPurshaseOrderRec = Me.CurrentRecord
    in the Toggle Event
    Code:
    'toggle between the screens
    Me.Purchase_Order_Detail_Subform.Visible = Not Me.Purchase_Order_Detail_Subform.Visible
    Me.Purchase_Order_Detail.Visible = Not Me.Purchase_Order_Detail.Visible
    Me.Purchase_Order_Detail.Requery
    Me.Purchase_Order_Detail_Subform.Requery
    
    
    If ((Me.Purchase_Order_Detail_Subform.Visible = True) and (CurrentPurshaseOrderRec>0)) Then
    DoCmd.GoToRecord acDataForm, [????], acGoTo, CurrentPurshaseOrderRec
    End If
    [????] < = I dont know what to put here if i put the form name it error saying not open

    am i doing it wrong
    Last edited by myle; 04-17-13 at 19:44. Reason: spelling
    hope this help

    See clear as mud


    StePhan McKillen
    the aim is store once, not store multiple times
    Remember... Optimize 'til you die!
    Progaming environment:
    Access based on my own environment: DAO3.6/A97/A2000/A2003/A2007/A2010
    VB based on my own environment: vb6 sp5
    ASP based on my own environment: 5.6
    VB-NET based on my own environment started 2007
    SQL-2005 based on my own environment started 2008
    MYLE
    YOUR PASSWORD IS JUST LIKE YOUR TOOTHBRUSH DON'T SHARE IT.

  2. #2
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    I would probably use the bookmark method, similar to this:

    Requery and stay on record

    Or if you actually want the record positioned as it was:

    Select A Row Page

    In other words, if record 5 was in the middle of the page, it will return to the middle instead of at the top like the bookmark method will typically do.

    By the way, I was just down in NZ. My daughter moved to Wellington early this year, and we just went down to visit. Beautiful place, but lonnng flight.
    Paul

  3. #3
    Join Date
    Feb 2004
    Location
    New Zealand
    Posts
    1,420
    Provided Answers: 7
    What am I missing
    Code:
        Set rs = [Form_Purchase Order Detail Subform].RecordsetClone
        rs.FindFirst "[Purchase Order Detail ID] = " & CurrentPurshaseOrderRec
        [Form_Purchase Order Detail Subform].Bookmark = rs.Bookmark
    and yes CurrentPurshaseOrderRec has a number in it

    but is does not goto that record ??
    hope this help

    See clear as mud


    StePhan McKillen
    the aim is store once, not store multiple times
    Remember... Optimize 'til you die!
    Progaming environment:
    Access based on my own environment: DAO3.6/A97/A2000/A2003/A2007/A2010
    VB based on my own environment: vb6 sp5
    ASP based on my own environment: 5.6
    VB-NET based on my own environment started 2007
    SQL-2005 based on my own environment started 2008
    MYLE
    YOUR PASSWORD IS JUST LIKE YOUR TOOTHBRUSH DON'T SHARE IT.

  4. #4
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    Doesn't look like valid syntax to refer to the subform:

    Forms: Refer to Form and Subform properties and controls
    Paul

  5. #5
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    Moreover, when you open two recordsets on the same data source (table or query), the bookmarks in both recordsets will be different, except if the second recordset was open from the RecordSetClone of a form. Use the value of an Identity column instead (usually the primary key).
    Have a nice day!

  6. #6
    Join Date
    Feb 2004
    Location
    New Zealand
    Posts
    1,420
    Provided Answers: 7
    Quote Originally Posted by Sinndho View Post
    Moreover, when you open two recordsets on the same data source (table or query), the bookmarks in both recordsets will be different, except if the second recordset was open from the RecordSetClone of a form. Use the value of an Identity column instead (usually the primary key).
    Ok look like more reading

    That went over my head

    Thanks
    hope this help

    See clear as mud


    StePhan McKillen
    the aim is store once, not store multiple times
    Remember... Optimize 'til you die!
    Progaming environment:
    Access based on my own environment: DAO3.6/A97/A2000/A2003/A2007/A2010
    VB based on my own environment: vb6 sp5
    ASP based on my own environment: 5.6
    VB-NET based on my own environment started 2007
    SQL-2005 based on my own environment started 2008
    MYLE
    YOUR PASSWORD IS JUST LIKE YOUR TOOTHBRUSH DON'T SHARE IT.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •