Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2012

    Unanswered: Making Label visible

    Hi all,
    I have a main form / subform arrangement with a label on the main form. I am the recordset for the main form has a yes/no field [posted] I want the label to be visible when the field is a yes. I am using the following code on the forms current event.

    If Me.frmShiftMain.posted = -1 Then
    Me.frmShiftMain.lblPosted.visible = True
    Else Me.frmShiftMain.lblPosted = False
    End If

    This seems to work ok except when the form first loads when it is visible even though the the record says it should not be. The overall objective is to have the label visible any time the field posted = yes

    Thanks Bob

  2. #2
    Join Date
    Nov 2011
    Where is this code run from? OnCurrentEvent or OnLoadEvent?
    If this is a Label, should not it be lblPosted.Caption = "Something" ?
    Is it not a TextBox instead? Why do you need to refer to the form? It is not necessary, just the control. Is the Label also on the Main Form?

  3. #3
    Join Date
    Nov 2004
    out on a limb
    Provided Answers: 59
    First off id recommend using the intrinsic vbconstants (vbtrue | vbfalse) in place of what you think is true or false.
    Second refer to the property you want to set. On the else statement you dont refer to the `visible` property.

    You could rephrase the whole codeblock with
    Lbposted.visible = posted.value
    I'd rather be riding on the Tiger 800 or the Norton

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts