Results 1 to 4 of 4
  1. #1
    ColPat is offline Novice
    Windows XP Access 2003
    Join Date
    May 2010
    Posts
    25

    Hide Textbox on form from function in module

    Hi,

    I want to call a function in a module to hide textboxes on a form.
    the form is called frName and one of the textboxes is txSStartDate.
    Have tried the following lines in the function
    Me.txSStartDate.Visible = False
    Me.frName.txSStartDate.Visible = False
    [Forms]![frName]![txSStartDate.Visible= False]
    but none work
    Anyone able to help?

  2. #2
    Datagopherdan is offline Competent Performer
    Windows 7 Access 2007
    Join Date
    Dec 2008
    Posts
    220
    Here's how you would do it.

    Create a function, which we'll call "HideTextBoxes"

    Code:
    Public Function HdeTextBoxes ()
    Forms!YourForm.txtbox1.Visible = False
    Forms!YourForm.txtbox2.Visible = False
    End Function
    Now on your form whereever you're going to have this triggered, you would just put this
    HdeTextBoxes

    If you don't mind my asking, why do you need to do it this way?

    [/CODE]

    Quote Originally Posted by ColPat View Post
    Hi,

    I want to call a function in a module to hide textboxes on a form.
    the form is called frName and one of the textboxes is txSStartDate.
    Have tried the following lines in the function
    Me.txSStartDate.Visible = False
    Me.frName.txSStartDate.Visible = False
    [Forms]![frName]![txSStartDate.Visible= False]
    but none work
    Anyone able to help?

  3. #3
    ColPat is offline Novice
    Windows XP Access 2003
    Join Date
    May 2010
    Posts
    25
    Just to reduce the amount of code on the form sheet as they are made visible and hidden from a number of commands on the form.

  4. #4
    ColPat is offline Novice
    Windows XP Access 2003
    Join Date
    May 2010
    Posts
    25
    Fantastic thanks

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

Similar Threads

  1. Track form and module design changes
    By c_smithwick in forum Modules
    Replies: 0
    Last Post: 05-11-2010, 10:28 AM
  2. Create Textbox with VBA in an existing form
    By ferrarih in forum Forms
    Replies: 0
    Last Post: 02-24-2010, 06:17 AM
  3. Replies: 1
    Last Post: 02-04-2010, 01:15 PM
  4. multiple textbox in a form
    By iamraja5 in forum Programming
    Replies: 2
    Last Post: 01-26-2010, 10:53 AM
  5. Replies: 6
    Last Post: 06-03-2009, 02:01 PM

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