Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8321991
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T23:13:06+00:00 2026-06-08T23:13:06+00:00

This question is mainly for curiosity, but also, in the description, I had intended

  • 0

This question is mainly for curiosity, but also, in the description, I had intended to highlight an infrequently documented behavior of Access.

Background

When creating an Access report, we can use the On Format method of the detail section to modify values or properties per-record. For example, assume we want to hide a field label when the value is empty:

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
    If (IsNull(Me.SomeField) Or Me.SomeField = "") Then
        Me.SomeFieldLabel.Visible = False
    Else
        Me.SomeFieldLabel.Visible = True
    End If
End Sub

What I did not realize about this until today is that the assignment .Visible = False does not modify the instance of the label in the Detail section, but rather is modifying the definition of the label on the report.

This can be demonstrated with the following modifiction to the code:

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
    If (IsNull(Me.SomeField) Or Me.SomeField = "") Then
        Me.SomeFieldLabel.Visible = False
    End If
End Sub

Assuming the label is initially visible (in form Designer), the event produces somewhat unexpected behavior: the label will remain visible until the first empty record; after that, it will remain hidden for all other records – I had originally expected that at each call of Detail_Format the controls where starting with their default definitions.

Question

Is there any way to reference the particular instance of a control within the Detail_Format event?

In this simple case of visible true/false, this is easily handled by just a simple if-then-else, but I can imagine more advanced scenarios where one might want to leave the default values in tact.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T23:13:08+00:00Added an answer on June 8, 2026 at 11:13 pm

    I don’t believe so, in all of my experience, properties of report objects always apply universally across the report, not to specific instances of the abject (if the object is repeated).

    For your example, I would use a text box instead of a label to label the field, and use something like =IIf(IsNull(Field1), "", "Label:") for the controlsource. That way it won’t show anything if the field is null, yet still show the label text if there is a value.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This question is mainly out of curiosity (I have a different working solution to
This question in mainly pointed at C/C++, but I guess other languages are relevant
This question is mainly directed at the PrimeFaces dev team but maybe someone else
This question is mainly directed at the PrimeFaces dev team but maybe someone else
This question is mainly about protecting the content inside my iOS app. I intend
This question is mainly to verify my current idea. I have a series of
This question is mainly aimed at shared libraries (.so files) compiled for Linux platforms.
This question and my answer below are mainly in response to an area of
Mainly this is a question about how to get a similar behaviour as java
Hey guys, hope this isn't too much of a n00b question I'm mainly a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.