Results 1 to 2 of 2
  1. #1
    xwnoob is offline Advanced Beginner
    Windows Vista Access 2000
    Join Date
    Nov 2011
    Posts
    76

    How do i open a form and hide a field?

    Currently i need to hide a listbox whenever i open a form. I think the best way to do this is to turn off the visible property.

    This is my code:



    Private Sub ShowCommitRecord_Click()


    DoCmd.OpenForm "AddCommitmentDetail", , , "CommitmentID=" & Me.ListShowCommit.Column(3), , , "Edit"
    DoCmd.Close acForm, "SelectEditCommitment"

    End Sub
    This is from a form where i select a record from a listbox and then open a form based on the selected record using a button.

    I dont know what is the visible syntax so could anyone tell me how to turn off the visible property of a control using vba when opening the form?

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Probably easier to set the Visible property to No in the listbox Properties window. Then use code to make visible when condition requires it.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Replies: 1
    Last Post: 12-04-2011, 09:11 PM
  2. Replies: 7
    Last Post: 01-12-2011, 08:59 AM
  3. Open form on update of field in another form.
    By thekruser in forum Forms
    Replies: 5
    Last Post: 09-13-2010, 02:12 PM
  4. Replies: 7
    Last Post: 11-29-2009, 01:44 PM
  5. In a field on a Form, on click open another form
    By jackieagra in forum Programming
    Replies: 1
    Last Post: 03-20-2008, 09:44 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