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

    Subform Visibility (AXP/Win2k)

    I have a form that contains a subform. I need the subform to be visible or invisible based on a value on the main form. For example, I use a drop down to select a customer. I have a subform with some alert information that only some customers have. I don't want the subform to be visible if the value is null in the subform.

    Thanks,
    Mark

  2. #2
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Subform Visibility (AXP/Win2k)

    In the on current event of the form enter something like this:
    <pre>If Me.tblContact_subform.Form.Recordset.RecordCount = 0 Then
    Me.tblContact_subform.Visible = False
    Else
    Me.tblContact_subform.Visible = True
    End If</pre>

    Francois

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

    Re: Subform Visibility (AXP/Win2k)

    Thanks,
    I tried this code but it makes the subform visible all of the time. Nothing I set for the data makes a difference. Could there be an issue with the Subform?

    Thanks,
    Mark

  4. #4
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Subform Visibility (AXP/Win2k)

    I don't know your application but what determine the fact that the subfrom has to be invisible ?
    An empty field ?
    then use:
    <pre>If IsNull(Me.tblContact_subform.Form!txtYourField) Then
    Me.tblContact_subform.Visible = False
    Else
    Me.tblContact_subform.Visible = True
    End If</pre>

    Francois

Posting Permissions

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