Results 1 to 8 of 8
  1. #1
    Join Date
    May 2004
    Posts
    144

    Unanswered: addressing subforms

    hi
    in my main page application form(frm_main) i have subform(subfrm_list) which includes a form (frm_list).
    now i want to create a button that when user click on it, cursor goes to last or new record in frm_list.
    i created a macro, but i dont know how to address frm_list. i have tried subfrm_list, frm_list, [frm_main]![frm_list], [frm_main]![subfrm_list] in object name field, but none of them worked out. access keep telling me object isnt open, despite it's open in subfrm.
    any help?
    Last edited by bono56; 12-12-09 at 06:59.

  2. #2
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    From the main form (frm_main), try:
    Code:
    Me.subfrm_list.Form.GotoRecord...
    From anywhere else, it becomes:
    Code:
    Forms!frm_main.subfrm_list.Form.GotoRecord...
    See also: Forms: Refer to Form and Subform properties and controls
    Have a nice day!

  3. #3
    Join Date
    May 2004
    Posts
    144
    tanx Sinndho, but i tried this one & it didnt work out:

    Code:
    Private Sub cmdNewRec_Click()
      DoCmd.GoToRecord acForm, "Me!subfrm_list.frm_list", acNewRec
    End Sub
    but it keeps telling me that form isnt open, despite frm_list is open in subfrm_list
    Last edited by bono56; 12-13-09 at 09:33.

  4. #4
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    In this case, try:
    Code:
       Me!subfrm_list.Form.Recordset.AddNew
    or:
    Code:
        frm_main!subfrm_list.Form.Recordset.AddNew
    Have a nice day!

  5. #5
    Join Date
    May 2004
    Posts
    144
    it didn't work out again

  6. #6
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    I don't know why because it should work. Have a look at the attached database.
    Attached Files Attached Files
    Have a nice day!

  7. #7
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    This is strange because it works perfectly here. Maybe there is something different in your Access configuration. Mine is: Microsoft Access 2003 (11.8.8166.8221) SP3 (VBA 6.05).
    Have a nice day!

  8. #8
    Join Date
    May 2004
    Posts
    144
    this is my database that dont work out.
    Attached Files Attached Files

Posting Permissions

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