Re: Check Box - text to appear
- From: "Brendan Reynolds" <brenreyn@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 20 Dec 2005 10:46:02 -0000
You'll need a different approach, then. Replace the label with a text box,
and enter the following expression as the Control Source property of the
text box ...
=IIf([Cancelled]=True,"Some Text","")
That's not a typo - there really are two i's in "IIf" - see "IIf Function"
in the help file for details.
Replace "Some Text" with the text you want to display if the check box is
ticked. Those are two double quotes with nothing between them at the end. If
you want to display different text when the check box is not ticked, enter
that text between those two double quotes. If you want to display nothing
when the check box is not ticked, leave the two double quotes at the end as
they are, with nothing between them.
--
Brendan Reynolds
"L" <L@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:644B7153-BF4B-4910-93D4-28B813F662EA@xxxxxxxxxxxxxxxx
> Yes it is.
> It is a form which I use to book training courses booked. One record per
> training course.
>
> "Brendan Reynolds" wrote:
>
>> Is this a continuous form?
>>
>> --
>> Brendan Reynolds
>>
>>
>> "L" <L@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
>> news:EB105A7B-B90E-4C6B-A807-4EA2864FA160@xxxxxxxxxxxxxxxx
>> > Hi,
>> >
>> > Thank you for your help. On both yours and Brendan's instructions, I
>> > have
>> > put the programming in, but when close the design view, every record
>> > shows
>> > the text.....argh! :)
>> >
>> >
>> > "Keith Wilby" wrote:
>> >
>> >> "L" <L@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
>> >> news:CC5D81C5-A44E-4E69-89C9-6D083E7EA84A@xxxxxxxxxxxxxxxx
>> >> > Hi,
>> >> >
>> >> > I'm a beginner/intermediate user of Access 2002 (Doing a lot of self
>> >> > teaching!)
>> >> >
>> >> > I want text to appear on a form when the check box is selected.
>> >> >
>> >> > The check box is called Cancelled and the label is called Label166.
>> >> >
>> >> > I understand that I need to put a formula in After Update on the
>> >> > check
>> >> > box
>> >> > properties, but don't know what to put in it. Could somebody let me
>> >> > know
>> >> > what
>> >> > I need to do. Thank you very much.
>> >> >
>> >> Something like this should do it (untested):
>> >>
>> >> Sub ShowLegend
>> >>
>> >> If Me.Cancelled Then
>> >> Me.Label166.Visible = True
>> >> Else
>> >> Me.Label166.Visible = False
>> >> End If
>> >> Me.Refresh
>> >>
>> >> End Sub
>> >>
>> >> Then call the sub from the check box Update event and the form's
>> >> Current
>> >> event. I'd also put a Refresh command in the check box Update event
>> >> after
>> >> the call.
>> >>
>> >> Incidentally, it's considered to be good practice to identify object
>> >> in
>> >> code
>> >> such that the names mean something to you. As your code grows and
>> >> becomes
>> >> more complex you'll be glad you did:
>> >>
>> >> If Me.chkCancelled Then
>> >> Me.lblLegend.Visible = True
>> >> Else
>> >> Me.lblLegend.Visible = False
>> >> End If
>> >>
>> >> HTH - Keith.
>> >> www.keithwilby.com
>> >>
>> >>
>> >>
>>
>>
>>
.
- Follow-Ups:
- Re: Check Box - text to appear
- From: L
- Re: Check Box - text to appear
- References:
- Re: Check Box - text to appear
- From: Keith Wilby
- Re: Check Box - text to appear
- From: L
- Re: Check Box - text to appear
- From: Brendan Reynolds
- Re: Check Box - text to appear
- From: L
- Re: Check Box - text to appear
- Prev by Date: Re: Weird solid border on labels for check boxes
- Next by Date: Re: Check Box - text to appear
- Previous by thread: Re: Check Box - text to appear
- Next by thread: Re: Check Box - text to appear
- Index(es):
Relevant Pages
|