Results 1 to 4 of 4
  1. #1
    3 Star Lounger
    Join Date
    Nov 2001
    Location
    Sydney, New South Wales, Australia
    Posts
    216
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I am trying to set up a checking mechanism to determine if a subform has records or not. Essentially, I am not sure which event is the best trigger.

    Just above the subform is a yes/no field for nominating whether records should exist, then of course the subform is there to list them. If the yes/no field is set to no, I've set the subform to be locked and disabled. When the yes/no is set to yes, I've tried a message box for when the form is deactivated and then I tried on lost focus but neither events work.

    Any suggestions please as to how and when to create a self-check for when sub-form has records?

    Thanks.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    If you lock/disable the subform if it doesn't contain any records, you make it impossible for the user to create a first record in the subform...

  3. #3
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,623
    Thanks
    3
    Thanked 60 Times in 60 Posts
    It's not clear to me what you are trying to achieve (it's early here so it may explain it). Are you wanting to activate the subform if the user clicks the Yes/No field to Yes? If so, you should be running code on the After Update event on that control, presumably a check box. Have you considered what should happen if there are subform records, and the user clicks the control to No? Can you give us description of what your goal is in enabling or disabling the subform.
    Wendell

  4. #4
    3 Star Lounger
    Join Date
    Nov 2001
    Location
    Sydney, New South Wales, Australia
    Posts
    216
    Thanks
    0
    Thanked 0 Times in 0 Posts
    The enabling/disabling of the subform works perfectly.

    I have solved it now. It was all about data validation and when to run the test.

    Thanks anyway.

Posting Permissions

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