Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2010
    Posts
    186

    Unanswered: creating 3 singles records on a mainform/subform set-up

    I have a data entry main form that has 2 single form subforms on it.
    Mainforms and subforms have required fields, and when the mainform record is opened subform1 and subform2 must be filled in.
    I have fields set to required, etc so access (this is '07) will prompt for the fields to be entered.....but what we really want is for subform1 and subform2 to create their new record as soon as the AutoID is created in the Mainform.

    Also - in this form there can only be a single record created in subform1 and subform2..then you're done. What happens now when you complete subform1 and the focus sets you into subform2 - subform1 jumps to a blank record 2 of 2 so the users get confused

    How do I set my subforms to only create a single record per mainform data entry?
    and can I force their new records when the mainform record is created?

  2. #2
    Join Date
    Oct 2009
    Posts
    340
    for part one - force a record into the subform(s) by writing to them a value; probably triggered in the AfterUpdate event of a control in the main form

    to prevent a subform from going to new record consider using the SetFocus at the exit of the subform's control(s) to go backwards to a control - rather than forward to next record.

    Hope this helps.
    www CahabaData com

  3. #3
    Join Date
    Jun 2010
    Posts
    186
    Good ideas -
    I'm not that advanced so not sure how to write the value. I can use the After Update of the ID control in the main form. The value will have to be the autonumber in ID fields of the 2 subfroms, but I'm not sure of the syntax.

    The setfocus in the first subform goes to the second subform, that's when it displays record 2(blank). Will I write multiple setfocus lines showing backwards in the first and forward to the 2nd subform in the same on_exit?

Posting Permissions

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