Results 1 to 3 of 3
  1. #1
    GraemeG is offline Competent Performer
    Windows Vista Access 2007
    Join Date
    Feb 2011
    Posts
    152

    Field Visible on a form depending on a table repsonse

    Hello.

    Is there a way to make a field on a form visible or not visible dependant on repsonses made in a table.



    I.e
    I want a button for admin tools to appear when the admin user is logged in.

    Code:
    Private Sub Form_Load()
    If Tbl_Users_EngineerID = "Administrator" And Tbl_Users_fldLoggedIn = True Then
    Me.cmdAdminTools.Visible = True
    Else
    Me.cmdAdminTools.Visible = False
    End If
    End Sub
    I have the above code but it does not work.
    Any help appreciated.

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    You can't get the table value that way. You'll need to open a recordset or use DLookup() to get them.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    kennejd is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Mar 2011
    Posts
    188
    Your example might work if the form is bound to a table or query that contains those fields. However, the syntax will probably need to be changed.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Making subform field visible/invisible
    By Snufflz in forum Forms
    Replies: 3
    Last Post: 01-17-2011, 05:30 AM
  2. Replies: 2
    Last Post: 01-06-2011, 04:38 AM
  3. Tab only visible when field = x
    By ecpike in forum Forms
    Replies: 7
    Last Post: 06-08-2009, 04:38 PM
  4. Return blank field depending on quantity
    By anthonyjf in forum Access
    Replies: 1
    Last Post: 04-01-2009, 08:22 AM
  5. Replies: 0
    Last Post: 03-16-2006, 04:59 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums