Results 1 to 5 of 5
  1. #1
    Star Lounger
    Join Date
    Mar 2004
    Posts
    92
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Hide fields on a form (2002)

    I am creating a database for financial reporting. The managers in a hospital input the data by "Unit" (their floor or department - like 3 Tower).
    I have a form and subform set up with a combo box that when I choose a Unit, the data for that Unit is displayed. The main form displays data that does not change for the fiscal year. The subform is a monthly data entry.

    The form is not set up as Data Entry because they want to be able to see the fiscal year data all the time. When the form opens, it always opens to a Unit's information that everyone can see..

    Is there a way to have the fields hidden or grayed out until the Unit is chosen?

    I would like to have it set up so that they can only see their Unit's information, but I haven't been able to come up with ideas on how to accomplish that -so it would be nice to at least gray or hide it..

    I don't write VB very well.
    Thank you.....

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Hide fields on a form (2002)

    >> Is there a way to have the fields hidden or grayed out until the Unit is chosen?

    Yes, there is, but I don't understand your purpose. If the form opens to an existing record, shouldn't the corresponding data be displayed?

    >> I would like to have it set up so that they can only see their Unit's information.

    For this, you will either have to let the users login to the database using a username/password combination, or get their network login name (see for example <post#=280661>post 280661</post#>). You could have a table in the database that lists the login names together with the appropriate unit.
    Create a query that selects only the records for the unit corresponding to the login name, and use the query as record source for the form.

  3. #3
    Star Lounger
    Join Date
    Mar 2004
    Posts
    92
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Hide fields on a form (2002)

    Thanks for the reply Hans,
    Yes, the corresponding data is displayed.
    The information that is displayed when the form opens will be seen by all managers. I was hoping to have them choose a Unit first, then only see their own information.
    I know they could choose other Units and look at the information anyway if they want to, but I'd like to at least limit it some if I could.

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Hide fields on a form (2002)

    You could leave the record source of the main form blank, and set it in code from the After Update event of the combo box.

    Or you can create a separate form with the combo box and a command button. The command button opens the main form filtered for the unit selected in the combo box.

  5. #5
    Star Lounger
    Join Date
    Mar 2004
    Posts
    92
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Hide fields on a form (2002)

    Thanks so much for the guidence, I will work on these.

Posting Permissions

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