Label not showing on subform if value is 0

Local time
Today, 19:21
Joined
Dec 10, 2024
Messages
62
Hi
I have created a small dashboard showing certain statistics of my business. This is comprised of small subform squares on my main menu. These subforms are based off queries, and the forms control performs a count or totals this various data. Attached screenshot 1 showing a blank subform, 2 showing it displaying when there is returned results in the query.

The issue I have is when there is nothing to count i.e no collections for example the form becomes completely blank. I would like the label to still appear and show 0 rather than just be blank.

I tried to add an IsNull IIF statement to the control which would show 0 instead of nothing but this doesn't work.
e.g

=IIf(IsNull(Count(([JobID]))),0,(Count([JobID])))

I've tried to add another label into the form as a test, and even this doesn't show if the query returns no results.

Also I've added an on click event to each of the subforms which loads a particular report to elaborate on the information. If the subform is blank the report opens, but if the subform has data clicking it does nothing. Why would this be?
 

Attachments

  • 1.jpg
    1.jpg
    83.3 KB · Views: 13
  • 2.png
    2.png
    48.3 KB · Views: 12
Is the label on the subform in the header or detail section? I would first make sure it’s in the subform header.
 
Put a label behind each sub-form with the message you want when the sub-form is empty. If the sub-form is empty, set it's Visible property to False.
 
Why use a subform in the first place? Is the idea that it expands if the user clicks on it?

Why not use a label or button? - I do something similar to show certain data and use color to indicate current status. Eg red might mean invoices to be raised or paid - user clicks on the label/button to open the relevant form
 

Users who are viewing this thread

Back
Top Bottom