Results 1 to 3 of 3
  1. #1
    Lounger
    Join Date
    Oct 2005
    Location
    Kansas City, Missouri
    Posts
    33
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Add New Record to Subform from Parent Form (2000)

    I did a search on this, and couldnt find what I'm hoping to accomplish...

    I have a parent form in single form view. On the parent form I have a subform in datasheet view (frmCallListingSubform). I would like to be able to add a Add Record comand button to the parent form (frmSalesMarketing) and set focus to a combo box of the subform (cboEmployee). I want to be able to click the button and go to a blank line, employee control for entry of a new record. Any suggestions? Thanks in advance! Hope I explained this well enough...

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Add New Record to Subform from Parent Form (2000)

    You can use code like this:

    Private Sub cmdNewSubformRecord_Click()
    Me.frmCallListingSubform.SetFocus
    RunCommand acCmdRecordsGoToNew
    Me.frmCallListingSubform!cboEmployee.SetFocus
    End Sub

    Important: frmCallListingSubform must be the name of the subform as a control on the main form. This is not necessarily the same as the name of the subform in the database window.

  3. #3
    Lounger
    Join Date
    Oct 2005
    Location
    Kansas City, Missouri
    Posts
    33
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Add New Record to Subform from Parent Form (2000)

    Thanks a ton Hans, I had tried so many different ways to get this done, and kept getting "action is not available" but this did the trick!

    Many kudos!

    <img src=/S/hailpraise.gif border=0 alt=hailpraise width=27 height=22>

Posting Permissions

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