Hide a label from a form

DarkHorseDarkHorse Member Posts: 389
Hello, I'd like to know how can I hide a label from a form filtered by user.
Thanks in advance.

Comments

  • ShedmanShedman Member Posts: 194
    CurrForm.LabelName.VISIBLE(FALSE);
    
  • DarkHorseDarkHorse Member Posts: 389
    Thanks for reply, but for example, if I put in OnOpenForm:

    IF USERID = 'USER' THEN
    CurrForm.'Foreign Trade'.VISIBLE(FALSE);

    It says to me that doesn't exist "Foreign Trade" variable ("Foreign Trade" it's the name's label). What's the problem, please?.
    Thanks for help
  • matttraxmatttrax Member Posts: 2,309
    Let's start with the bigger problem in that you are hard coding user ids. REALLY bad programming. Search the forum for something like "Hide fields for specific users".

    As for the VISIBLE property, did you actually give a name to your label box? By default it will be something like <Control30>, not the variable / value it holds.
  • DarkHorseDarkHorse Member Posts: 389
    Thanks, well, the only way where I can find a name form the laben is on properties on "PageNames", on appears the name of the label.
    If I want to hide the 'Foreign Trade' label, from Item form, how's the code?
    Thanks.
  • Luc_VanDyckLuc_VanDyck Member, Moderator, Administrator Posts: 3,633
    "Foreign Trade" is not a label, but a PageName (or tab). And this cannot be made hidden at run-time.
    No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)
  • DarkHorseDarkHorse Member Posts: 389
    Ups!, well, in that case there's not much to do.
    Thanks everybody for help.
Sign In or Register to comment.