OK. I have been working on this quite a while and can't seem to get it. I checked out the archives here and tried almost everything that had been suggested in the past with no luck. Maybe it makes a difference because my subforms are not visible.
I have designed a form that contains 2 subforms. I have made the subforms not visible unless they contain records by using the following code in the main forms OnCurrent Event:
Private Sub Form_Current()
With Me![tblCoupons].Form
.Visible = (.RecordsetClone.RecordCount > 0)
End With
With Me![sfrmCouponsStorecategory].Form
.Visible = (.RecordsetClone.RecordCount > 0)
End With
End Sub
I ripped the code from a tutorial as I haven't been playing with Access long enough to have it down. It works great if I close the main form and then come back to the record, the appropriate subform (if any) is visible with the correct data in it or it is not visible if there are no records.
How can I get this to happen without closing and coming back in. Please reply in simple terms/examples.
(I have already tried:
me.requery
me.refresh
combobox.requery
and almost everything else listed in the archives, here)
Thanks in advance.
I have designed a form that contains 2 subforms. I have made the subforms not visible unless they contain records by using the following code in the main forms OnCurrent Event:
Private Sub Form_Current()
With Me![tblCoupons].Form
.Visible = (.RecordsetClone.RecordCount > 0)
End With
With Me![sfrmCouponsStorecategory].Form
.Visible = (.RecordsetClone.RecordCount > 0)
End With
End Sub
I ripped the code from a tutorial as I haven't been playing with Access long enough to have it down. It works great if I close the main form and then come back to the record, the appropriate subform (if any) is visible with the correct data in it or it is not visible if there are no records.
How can I get this to happen without closing and coming back in. Please reply in simple terms/examples.
(I have already tried:
me.requery
me.refresh
combobox.requery
and almost everything else listed in the archives, here)
Thanks in advance.