Results 1 to 6 of 6
  1. #1
    Biologybook is offline Novice
    Windows XP Access 2007
    Join Date
    Sep 2011
    Posts
    9

    Question How do I hide "empty" labels/text boxes in my forms

    I am trying to create a form for use in a manufacturing process. The first couple columns in my table are filled with parameters and the last 5 columns are for steps in the process (i.e. Steps A-E). I want to make a unique form for each row.



    Some processes only need 2-3 step though; so these cells are left blank. These "empty" fields still show up on my form.

    Is there anyway to hide these?



    Thanks for your help in advance!

  2. #2
    Robeen is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Mar 2011
    Location
    Tulsa, Oklahoma.
    Posts
    1,596
    If you don't need them on your Form, you can choose not to put them on when you design the Form.

    In Design mode - you can right-click on the field that you don't neet, Select 'Properties' and then set the 'Visible' property to 'No' [or False].

    If you REALLY don't need certain fields [controls] to show on you Form - you can delete the controls [Right-Click -> Delete].

    If you want the fields to show under certain conditions, you can write code that sets the Visible Property of a certain control to False.

  3. #3
    Biologybook is offline Novice
    Windows XP Access 2007
    Join Date
    Sep 2011
    Posts
    9
    Thanks for the quick response!

    I need fields to show under certain conditions. The condition being if there is text in the box. If there is no step D and E for a process, I don't want it showing up on my form as a blank box.

    Writing code? I am just learning Access and don't know what you're referring too.

  4. #4
    Robeen is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Mar 2011
    Location
    Tulsa, Oklahoma.
    Posts
    1,596
    Are you using your Form to enter data or just to display it?

  5. #5
    Biologybook is offline Novice
    Windows XP Access 2007
    Join Date
    Sep 2011
    Posts
    9
    just display it for the machine operators.

  6. #6
    Robeen is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Mar 2011
    Location
    Tulsa, Oklahoma.
    Posts
    1,596
    Here is a quick code snippet for you to play with.

    I worked this up before you replied but you might be able to use it.

    I put a command button on a simple form and called it Command9.
    I also have text boxes called Step4 & Step5.

    When I click the Command Button, if the 'Process' Text Box has "X" then Text Boxes 'Step4' & 'Step5' are turned to Visible = False.

    Code:
     
    Private Sub Command9_Click()
     
    If Me!Process = "X" Then
    Me!Step4.Visible = False
    Me!Step5.Visible = False
     
    End If
    This is to give you an idea of how writing Code works.

    Here's what you do if you want to replicate what I did.

    Put a command button on your Form.
    RIght-Click the command Button and click 'Build Event' and then select 'Code Builder'.
    You should be taken to the Visual basic Editor and should see something like this:

    Private Sub Command9_Click()

    End Sub

    Between those two lines is where you would enter the code to tell your application what you want to happen when you click the command button.

    Your goal is to put this code where it will be run each time a new record is loaded into the Form.

    All the best!!

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

Similar Threads

  1. Replies: 16
    Last Post: 07-22-2011, 09:23 AM
  2. Replies: 1
    Last Post: 04-25-2011, 12:36 PM
  3. "Group By" causes "ODBC--Call Failed" error
    By kaledev in forum Queries
    Replies: 1
    Last Post: 03-09-2011, 02:43 PM
  4. Replies: 3
    Last Post: 10-21-2010, 10:54 AM
  5. replace a empty field with the word "none" how??
    By techexpressinc in forum Queries
    Replies: 1
    Last Post: 01-15-2010, 11:02 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