Hide a label from a form

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

  • Shedman
    Shedman Member Posts: 194
    CurrForm.LabelName.VISIBLE(FALSE);
    
  • DarkHorse
    DarkHorse 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
  • matttrax
    matttrax 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.
  • DarkHorse
    DarkHorse 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_VanDyck
    Luc_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)
  • DarkHorse
    DarkHorse Member Posts: 389
    Ups!, well, in that case there's not much to do.
    Thanks everybody for help.