Results 1 to 5 of 5
  1. #1
    4 Star Lounger
    Join Date
    Jun 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    527
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Return value from subform (A2k2)

    What is the string I use to check if a subform has records or not? I have a subform that is shown in datasheet view. All I want to do is to check to see if that subform has records or not. I have tried this but it does like it!

    If Forms![wo_update]![part_temp subform].Form.RecordCount > 0 Then......

    Thanks,
    Mark

  2. #2
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: Return value from subform (A2k2)

    >>If Forms![wo_update]![part_temp subform].Form.RecordCount > 0 <<

    In your code above, exactly what is [part_temp subform]? In order for what you wrote to work, that needs to be the name of the control on the mainform that contains the subform. It should NOT be the name of the subform itself (unless the form name and the control name are the same).
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

  3. #3
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: Return value from subform (A2k2)

    One more thing, find the recordcount via the recordsetclone property like this:

    If Forms![wo_update]![part_temp subform].Form.recordsetclone.RecordCount > 0 Then
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

  4. #4
    4 Star Lounger
    Join Date
    Jun 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    527
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Return value from subform (A2k2)

    Thanks Mark,
    What I have is this:

    wo_update = main form
    part_temp subform = subform on wo_update

    Thanks,
    Mark

  5. #5
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: Return value from subform (A2k2)

    Then this should work:

    If Forms![wo_update]![part_temp subform].Form.recordsetclone.RecordCount > 0 Then
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

Posting Permissions

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