Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

Change Visible Property of Report Label with Message Box Code

Discussion in 'Information Technology' started by TKD, Jul 28, 2006.

  1. TKD

    TKD
    Expand Collapse
    Guest

    How do I change the visible property (true to false) of a label in an Access
    2003 report using a message box (code)?
     
  2. Loading...


  3. tina

    tina
    Expand Collapse
    Guest

    If MsgBox("your message", vbYesNo) = vbYes Then
    Me!LabelName.Visible = False
    End If

    hth


    "TKD" <TKD@discussions.microsoft.com> wrote in message
    news:F2D1DF91-403B-4BE5-AF6B-1FF67222BEDA@microsoft.com...
    > How do I change the visible property (true to false) of a label in an

    Access
    > 2003 report using a message box (code)?
     
  4. Douglas J. Steele

    Douglas J. Steele
    Expand Collapse
    Guest

    Or, even shorter,

    Me!LabelName.Visible = (MsgBox("your message", vbYesNo) = vbYes)

    Note that I reversed the comparison you were doing: you were setting the
    label to not visible if the user selected Yes, whereas I assume that the
    message would be along the lines of "Do you want the label to be visible?"
    (so that clicking on Yes would mean they want it visible)


    --
    Doug Steele, Microsoft Access MVP
    http://I.Am/DougSteele
    (no private e-mails, please)


    "tina" <nospam@address.com> wrote in message
    news:0%Tpg.299537$Fs1.210795@bgtnsc05-news.ops.worldnet.att.net...
    > If MsgBox("your message", vbYesNo) = vbYes Then
    > Me!LabelName.Visible = False
    > End If
    >
    > hth
    >
    >
    > "TKD" <TKD@discussions.microsoft.com> wrote in message
    > news:F2D1DF91-403B-4BE5-AF6B-1FF67222BEDA@microsoft.com...
    >> How do I change the visible property (true to false) of a label in an

    > Access
    >> 2003 report using a message box (code)?

    >
    >
     
  5. TKD

    TKD
    Expand Collapse
    Guest

    Doug, that's exactly what I wanted it to do (I typed the prperties in reverse
    order). Works great.

    Thanks to you and Tina for your quick responses!

    TKD

    "Douglas J. Steele" wrote:

    > Or, even shorter,
    >
    > Me!LabelName.Visible = (MsgBox("your message", vbYesNo) = vbYes)
    >
    > Note that I reversed the comparison you were doing: you were setting the
    > label to not visible if the user selected Yes, whereas I assume that the
    > message would be along the lines of "Do you want the label to be visible?"
    > (so that clicking on Yes would mean they want it visible)
    >
    >
    > --
    > Doug Steele, Microsoft Access MVP
    > http://I.Am/DougSteele
    > (no private e-mails, please)
    >
    >
    > "tina" <nospam@address.com> wrote in message
    > news:0%Tpg.299537$Fs1.210795@bgtnsc05-news.ops.worldnet.att.net...
    > > If MsgBox("your message", vbYesNo) = vbYes Then
    > > Me!LabelName.Visible = False
    > > End If
    > >
    > > hth
    > >
    > >
    > > "TKD" <TKD@discussions.microsoft.com> wrote in message
    > > news:F2D1DF91-403B-4BE5-AF6B-1FF67222BEDA@microsoft.com...
    > >> How do I change the visible property (true to false) of a label in an

    > > Access
    > >> 2003 report using a message box (code)?

    > >
    > >

    >
    >
    >
     
  6. TKD

    TKD
    Expand Collapse
    Guest

    Thanks Tina!

    "tina" wrote:

    > If MsgBox("your message", vbYesNo) = vbYes Then
    > Me!LabelName.Visible = False
    > End If
    >
    > hth
    >
    >
    > "TKD" <TKD@discussions.microsoft.com> wrote in message
    > news:F2D1DF91-403B-4BE5-AF6B-1FF67222BEDA@microsoft.com...
    > > How do I change the visible property (true to false) of a label in an

    > Access
    > > 2003 report using a message box (code)?

    >
    >
    >
     

Share This Page