Full Version: Checkbox on Report based on control value
UtterAccess Discussion Forums > Microsoft® Access > Access Reports
RFree190
I'm not sure of the best way to approach this...
I have a control on my report [ServiceConfNo] that lists HOME, WORK, HIS CELL or HER CELL.
How can I use this value to turn off or on one of 4 checkboxes on the report?

This is what I have on the ON LOAD of the report:
CODE
If Me.ServiceConfNo = "HOME" Then
    Me.Conf1 = true
    Else
    If Me.ServiceConfNo = "WORK" Then
        Me.Conf2 = true
        Else
        If Me.ServiceConfNo = "HIS CELL" Then
            Me.Conf3 = true
            Else
            If Me.ServiceConfNo = "HER CELL" Then
                Me.Conf4 = true
End If
End If
End If
End If


I'm hoping this is something simple, but just can't put my finger on it.

Thanks for any pointers,
Rick
theDBguy
Hi Rick,

Wouldn't it be easier to turn them on at the query level? For example, in the query for your report, you could add a column such as:

ConfA: IIf(ServiceConfNo = "home", True, False)

and so on for the other ones too. Then in your report, use these columns instead of the fields from the table.

Just my 2 cents...
RFree190
QUOTE (theDBguy @ Jul 29 2010, 11:23 PM) *
Hi Rick,

Wouldn't it be easier to turn them on at the query level? For example, in the query for your report, you could add a column such as:

ConfA: IIf(ServiceConfNo = "home", True, False)

and so on for the other ones too. Then in your report, use these columns instead of the fields from the table.

Just my 2 cents...

I like those 2 cents...
See, that's why I love this site. When my mind goes blank, I always know there is someone out there to help me out...

Thanks DBGuy!

theDBguy
Hi,

yw.gif

Glad we could help. Good luck with your project.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.