Hi,
I have a form which contains a number of subforms in different pages of a
tab control. In the detail section of each subform, I list records related
to the main form record, but from different tables. In the footer section
of the subform I have a Notes text box and three buttons (Add, Update,
Delete). The latter each open a separate form for updating or deleting the
subform data (the records cannot be updated or deleted directly from the
subform which is for display only). The Notes field displays an additional
(large) field from the record selected in the subform list.
The subforms are loaded via the Current event of the main form.
If there are no records to display in the subform, I would like to make the
Notes control and the Update and Delete buttons not visible (leaving just
the Add button visible). To do this, I created a recordset in the main form
Current event using the same SQL as that used to load the subform table. If
the record count is zero, then I set the .Visible property of the Notes
field and the two buttons to FALSE.
This works fine -- except that once made not visible, they cannot be made
visible again on a new main form record when the subform record count is GT
zero. In fact, through experimenting, I have found that just mentioning the
..Visible property of these controls via the main form Current event makes
them invisible -- even if the only mention is to set .Visible TRUE!
What is going on???
I realise that the footer contents are intended to remain static for all
records. Is this the problem, that it is "illegal" to make the contents
data dependent? Or what?
Any advice and assistance greatly appreciated. (Access 2003, WinXP)
--
Cheers,
Lyn.