Form detail rows

foxy

Registered User.
Local time
Today, 18:57
Joined
Feb 17, 2009
Messages
64
Hi,
I have a form (continuous) that shows several records, each in an individual detail row.
Depending on a value in each of the detail rows, I want to display a specific label and hide others. This needs to evaluate for each separate detail row.
This is the code I have.

Code:
Private Sub Form_Load()
If archive = -1 Then
    ArchiveLabel.Visible = True
    open_date.Visible = False
    form_date.Visible = False
    close_date.Visible = False
ElseIf archive = 0 Then
    ArchiveLabel.Visible = False
    open_date.Visible = True
    form_date.Visible = True
    close_date.Visible = True
End If
End Sub

Currently, this is just checking the value of the first record returned, and then applying the visibility to all of the detail rows on the form.
How can I get this to evaluate each detail row separately?

Cheers,
Chris
 
When you are dealing with continuous forms that sort of set up will be reflected in all records dependant on the record that currently holds focus.

Your best bet is to have a look at conditional formatting.
 
Last edited:
Continuous Forms don't work like that. Each form is the same form so changing any property changes them all.

Simulate the labels using textboxes. Disable and Lock them and make the border transparent.

Then use ConditionalFormatting to make the ForeColor of the "labels" change to the BackColor for those you want to hide.

Alternatively the "labels" can be bound to the RecordSource query where you calculate a value to display as a "label" or make it Null to be invisible.
 

Users who are viewing this thread

Back
Top Bottom