Re: Check Box - text to appear

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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
>> >>
>> >>
>> >>
>>
>>
>>


.



Relevant Pages

  • Re: Check Box - text to appear
    ... "Brendan Reynolds" wrote: ... Those are two double quotes with nothing between them at the end. ... > you want to display different text when the check box is not ticked, ... >> It is a form which I use to book training courses booked. ...
    (microsoft.public.access.forms)
  • Re: Cascaded Drop Down Lists in Access 2007...
    ... Each row of a continuous form does not have its own RowSource values, i.e. there is only one for all the rows. ... Consequently the combo will display blank if: ... The bound column is not the display column ...
    (microsoft.public.access.formscoding)
  • Re: Question on displaying repeating data
    ... Next, I have to choose the link from the main form, to the subform. ... >> of historical quotes. ... The query logic is relatively simple. ... >> My problem is that I don't know how to display this. ...
    (microsoft.public.access.forms)
  • Re: How-To: Hide Repeating Values in a continuous form ?!?
    ... On Apr 16, 4:59 pm, Peter Hibbs ... your Continuous form. ... This may slow down the display if you have a ... I tried using "OnCurrent" as my trigger. ...
    (microsoft.public.access.forms)
  • Re: Can CheckBox be disable in Continuous Forms
    ... I have a continuous form that can display 2 complete records at a ... otherwise prevent changes) to the archived record on the continuous form ... and use conditional formatting to gray it on ... Allen Browne - Microsoft MVP. ...
    (microsoft.public.access.formscoding)