CharlieT302
Instructor
Hi Folks,
I am using Dcount to trigger code. Basically, I have a subform that may or may not return values. If there are no values, the form is completely blank without even a blank row. Functionally not relevant, but aesthetically not pleasing.
I have separate unbound version of the subform (that is stacked on top of the bound form) that I would like to display if the record source is empty. This way I will always see a form with at least one blank record.
What I Need:
If Dcount returns one or more records, I want the normal bound form to be visible. If nothing is returned, I want the unbound form to be visible.
Ex: Dcount("*","DataSource") > 0 then
MyUnBoundform.Visible = False
else
MyUnBoundForm.Visible = True
The problem is that Dcount returns nothing if there are no records. Therefore, the "else" is never evaluated.
How can I work around this?
I am using Dcount to trigger code. Basically, I have a subform that may or may not return values. If there are no values, the form is completely blank without even a blank row. Functionally not relevant, but aesthetically not pleasing.
I have separate unbound version of the subform (that is stacked on top of the bound form) that I would like to display if the record source is empty. This way I will always see a form with at least one blank record.
What I Need:
If Dcount returns one or more records, I want the normal bound form to be visible. If nothing is returned, I want the unbound form to be visible.
Ex: Dcount("*","DataSource") > 0 then
MyUnBoundform.Visible = False
else
MyUnBoundForm.Visible = True
The problem is that Dcount returns nothing if there are no records. Therefore, the "else" is never evaluated.
How can I work around this?