Adding Multiple Records to SubForm

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • JPetersen
    New Member
    • Mar 2016
    • 4

    Adding Multiple Records to SubForm

    I want to add several records to the subform. This works until line 4 (error 2105; can't go to specified record. Can't I keep adding records like this?

    Code:
    Me.frmMissingItems_Subform.SetFocus
    
    DoCmd.GoToRecord , , acNewRec
    Forms!frmPCSTracker!frmMissingItems_Subform!MissingID = "1"
    
    DoCmd.GoToRecord , , acNewRec
    Forms!frmPCSTracker!frmMissingItems_Subform!MissingID = "2"
    
    DoCmd.GoToRecord , , acNewRec
    Forms!frmPCSTracker!frmMissingItems_Subform!MissingID = "3"
    Last edited by Rabbit; Mar 2 '16, 12:18 AM. Reason: Please use [code] and [/code] tags when posting code or formatted data.
  • twinnyfo
    Recognized Expert Moderator Specialist
    • Nov 2011
    • 3662

    #2
    If I read your code correctly, you are adding a record to the main form, not the subform.

    I would ask why you want or need to add records to a subform programmaticall y. This might help us understand what you are trying to do and offer, perhaps, some alternate solutions.

    Comment

    Working...