PDA

Click to See Complete Forum and Search --> : How to make a subform disappear


spikeybloke
Nov 12th, 2003, 03:00 PM
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.

texas
Nov 12th, 2003, 04:30 PM
this worked for me...

Form_Frm_Batch_Sub.Visible = False


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

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

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