Count of records on subform inside a tab

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have two subforms, each inside a single tab control (one tab for each
subform).

I'm trying to count the records on those subforms so I can determine to
'disable' a tab when the subform has no records returned.

I can't get the subforms to count their records when none are returned. I
get a blank field, but the field isn't equal to 0, null, empty or "".

Anyone know what's going on?
 
Robert_L_Ross said:
I have two subforms, each inside a single tab control (one tab for each
subform).

I'm trying to count the records on those subforms so I can determine to
'disable' a tab when the subform has no records returned.

I can't get the subforms to count their records when none are returned. I
get a blank field, but the field isn't equal to 0, null, empty or "".


I don't think using a text box control with the expression
=Count(*) can be used in VBA code because control expression
calculations are done asynchronously. I.e. your test code
might run before the calculation is done.

It's not clear where/when you want to disable the tab, but
I'll guess it would be in the main form's Current event:

Me.tabctl.Pages(x).Enabled = _
Me.subformcontrol.Form.RecordCount > 0
 
Back
Top