Results 1 to 6 of 6
  1. #1
    mick3911 is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Feb 2013
    Location
    Wirral, UK
    Posts
    66

    Subform Go To New Record

    I have a form (Employee Training Record) which has a subform (Add Training Record).

    When the Employee Training Record form opens, the subform is set to go to new record by embedded macro, which works fine.

    The Employee Training Record form has a combo box to search for employees. When you click on an employee’s name, their particular record opens, so far so good.



    The problem that I have and hope you can help me with is that when opening an employee’s record from the combo box, the subform does not go to a new record.

    How can I resolve this?

    TIA

  2. #2
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    in the after update event of your main form combo try
    Code:
    Me.[YourSubformControlName].SetFocus
    Form_[YourSubformControlName].Recordset.AddNew
    Can't say I've ever considered using a sub form to add records to a main. I don't usually care for split forms, but in this case, maybe it would be easier for you?
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #3
    mick3911 is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Feb 2013
    Location
    Wirral, UK
    Posts
    66
    Hi Micron,

    Thanks for your reply.

    I have tried your solution but when I select an employee from the combo box it doesn't like "Recordset".

  4. #4
    mick3911 is offline Advanced Beginner
    Windows 10 Access 2010 32bit
    Join Date
    Feb 2013
    Location
    Wirral, UK
    Posts
    66
    Have solved it by inserting the following;

    Me.[forname].SetFocus
    DoCmd.GoToRecord, , acNewRec

  5. #5
    Join Date
    May 2018
    Location
    Living in Scotland UK
    Posts
    1,557
    Hi Mick

    It is the usual practice to have a MainForm Subform with the subform displaying all related records to the Main Form.

    Why not just have a Command Button on the Subform to Go to New Record?

  6. #6
    Join Date
    May 2018
    Location
    Living in Scotland UK
    Posts
    1,557
    Hi

    If you have "Me.[forname].SetFocus" which indicates you have forname as a Control on the Subform ??

    Why do you have forname as a Control on the subform? If your Forms are linked correctly you do not need this duplication.



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

Similar Threads

  1. Replies: 1
    Last Post: 03-16-2017, 10:16 AM
  2. Replies: 7
    Last Post: 04-15-2014, 01:15 PM
  3. Replies: 8
    Last Post: 08-09-2013, 09:52 AM
  4. Replies: 6
    Last Post: 08-22-2012, 03:24 AM
  5. Replies: 6
    Last Post: 05-05-2012, 08:43 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