Welcome to SPN

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

Sign Up Now!
  1.   Become a Supporter    ::   Make a Contribution   
    Target (Recurring Monthly): $200 :: Achieved: $98

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

    >
    >
    >
     
Since you're here... we have a small favor to ask...

More people are visiting & reading SPN than ever but far fewer are paying to sustain it. Advertising revenues across the online media have fallen fast. So you can see why we need to ask for your help. Donating to SPN's is vote for free speech, for diversity of opinions, for the right of the people to stand up to religious bigotry. Without any affiliation to any organization, this constant struggle takes a lot of hard work to sustain as we entirely depend on the contributions of our esteemed writers/readers. We do it because we believe our perspective matters – because it might well be your perspective, too... Fund our efforts and together we can keep the world informed about the real Sikh Sikhi Sikhism. If everyone who writes or reads our content, who likes it, helps us to pay for it, our future would be much more secure. Every Contribution Matters, Contribute Generously!

    Become a Supporter      ::     Make a Contribution     



Share This Page