Results 1 to 2 of 2

Thread: How to make a subform disappear

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2003
    Posts
    1

    How to make a subform disappear

    Before I start.... yes this IS coursework. I've been trying to get round this part for over a week so any pointers would be greatly appreciated.

    I have a music database. The main form has browse buttons to look through the database. There are 2 subforms, one for CD1, the other for CD2. If there is no 2nd CD in the file, subform_CD2 should not be visible. I have it linked to a query, to show any record with a 2nd CD in subform_CD2. This part I ahve working perfectly. I ust can't get the subform to disappear when there is no 2nd CD.

    I have tried code in the main form on form load, along the lines of

    If query_CD2.disk = 2 then
    track_subform_CD2.Visible = True
    Else
    track_subform_CD2.Visible = False
    End If

    I have also tried in the subform, form load

    If [track_subform_CD2]![track] = " " Then
    track_subform_CD2.Visible = False
    Else
    track_subform_CD2.Visible = True
    End If

    I 've tried different variations of the =2, to >1, <>1 but with no luck. The most that happens is the subform turns white.

    Help!!!!!!!!!!

    Many thanks.

  2. #2
    Hyperactive Member
    Join Date
    Aug 2001
    Location
    Austin
    Posts
    397
    this worked for me...

    Form_Frm_Batch_Sub.Visible = False


    -----------------------

    form_(your sub-form name).visible = false

    -----------------------
    Last edited by texas; Nov 12th, 2003 at 05:34 PM.

Posting Permissions

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



Click Here to Expand Forum to Full Width