Results 1 to 5 of 5
  1. #1
    tonez90 is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jul 2014
    Location
    Australia
    Posts
    18

    Moving to record on a continuous sub-form

    Hi I am trying to move to a record on a sub-form (frm_MHF_Entry!SubFrm_MHFTasks) based on an item on another screen (fmractivities).
    Essentially the user would select the record from a list (which has "recno") on frmactivities and when they double click it opens another form which has a continuous sub-form based on a column value from a list box. The selection and numbers are working fine.


    recno is the unique identifier on the sub-form records.

    I am trying to use this code but it seems not to like the "set rs = " line. Any suggestion? Sorry DB too big to post.

    Dim rs As DAO.Recordset
    Set rs = Forms!frm_MHF_Entry!SubFrm_MHFTasks.Recordset.Clon e <-----------SEEMS TO HOLD here and gives error 438
    rs.FindFirst "[recno] = " & Me![lstActive].Column(1)
    If Not rs.NoMatch Then Forms!frm_MHF_Entry!SubFrm_MHFTasks.Bookmark = rs.Bookmark
    rs.Close
    Set rs = Nothing

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,928
    Try

    Forms!frm_MHF_Entry!SubFrm_MHFTasks.Form.RecordsetClone

    note removed period between Recordset and Clone

    and also

    Forms!frm_MHF_Entry!SubFrm_MHFTasks.Form.Bookmark
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Join Date
    Apr 2017
    Posts
    1,679
    Why you don't use simply linked parent and subform - p.e. as I adviced in another thread https://www.accessforums.net/showthread.php?t=67911 . There are all elements you described - selecting a value in combobox and subform displaying records according you selection. Plus automatically adding records linked to selection, whenever you add a record into subform.

  4. #4
    tonez90 is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jul 2014
    Location
    Australia
    Posts
    18

    Moving to record on a continuous sub-form

    Thanks for reply unfortunately the form I am calling from is a result of a Union record set (activity not closed outfrom multiple projects) and so I use the actual record (recno) along with the specific type (construction etc and project_number) in which to open a specific form (i.e. construction tasks) and thus a specific recordset (specific project and type) with appropriate filters.
    I have tried opening the form to the top level project (based on project_number) and that works but when I go to use the goto record (recno) components they just don't seem to work.

    Oh well I will just keep trying.

  5. #5
    tonez90 is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jul 2014
    Location
    Australia
    Posts
    18

    Moving to record on a continuous sub-form

    Thanks this worked a treat.

    Thanks for the help
    This is the VBA I use from other forms
    Dim rs As DAO.Recordset
    Set rs = Forms!frm_MHF_Entry!SubFrm_MHFTasks.Form.Recordset Clone
    rs.FindFirst "[recno] = " & Me![lstActive].Column(1)
    If Not rs.NoMatch Then Forms!frm_MHF_Entry!SubFrm_MHFTasks.Form.Bookmark = rs.Bookmark
    rs.Close
    Set rs = Nothing


    Quote Originally Posted by June7 View Post
    Try

    Forms!frm_MHF_Entry!SubFrm_MHFTasks.Form.RecordsetClone

    note removed period between Recordset and Clone

    and also

    Forms!frm_MHF_Entry!SubFrm_MHFTasks.Form.Bookmark

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

Similar Threads

  1. Replies: 22
    Last Post: 12-17-2014, 06:38 PM
  2. Moving Rows in Continuous Form Up/Down and Top/Bottom
    By RichardAnderson in forum Forms
    Replies: 2
    Last Post: 01-22-2014, 02:43 PM
  3. Moving to next/previous record in a form.
    By ser01 in forum Programming
    Replies: 3
    Last Post: 08-07-2012, 06:11 PM
  4. Moving to new record from a different form
    By liam_898 in forum Forms
    Replies: 12
    Last Post: 05-05-2012, 12:34 PM
  5. Hiding a new record in a continuous form
    By system243trd in forum Forms
    Replies: 3
    Last Post: 12-03-2011, 01:04 AM

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