Results 1 to 5 of 5
  1. #1
    4 Star Lounger
    Join Date
    May 2003
    Location
    Manchester, Gtr Manchester, England
    Posts
    552
    Thanks
    0
    Thanked 0 Times in 0 Posts

    sub form access restriction (2000)

    Hi, have a parent and child form, due to some of the modelling it is possible to populate one field on the sub before I activate the record on the parent, this clearly causes problems, how can I have the child auto de activated on open or a new record for it only to 'activate' after the main form record is activated?

    Thanks Darrenn.

  2. #2
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: sub form access restriction (2000)

    If the child form is properly linked to the parent form using the master and child links, it eliminates the problem you are describing because the only child records available are those that relate to the parent record. That means that unless the parent record exists, there is no child record to change.
    Charlotte

  3. #3
    4 Star Lounger
    Join Date
    May 2003
    Location
    Manchester, Gtr Manchester, England
    Posts
    552
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: sub form access restriction (2000)

    Thanks Charlotte, iit is propoerly linked but I have two fields on the child that are populated bt synchronised combo boxes that sit on the main form. It is possible for a user to initiate those sunch boxes and populate the related boxes on the child before the master is activated, I then have probelms and error messages?

    Thanks Darren.

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

    Re: sub form access restriction (2000)

    I would prevent the combo boxes from populating controls in the subform if there is no record in the main form, by building a check into the After Update event of the combo boxes.
    Or even disable the combo boxes if there is no record in the main form, you would use code in the On Current and Before Insert events of the form for this.

  5. #5
    4 Star Lounger
    Join Date
    May 2003
    Location
    Manchester, Gtr Manchester, England
    Posts
    552
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: sub form access restriction (2000)

    Thanks Hans, for reference if others are interest I set the on current to "Me.[cmbWT].Enabled = Not IsNull(Me.ID)
    Me.[cmbWTG].Enabled = Not IsNull(Me.ID)" nd the before insert to Me.[cmbWT].Enabled = True
    Me.[cmbWTG].Enabled = True

    Regards Darren

Posting Permissions

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