Results 1 to 3 of 3
  1. #1
    SRSA is offline Novice
    Windows XP Access 2003
    Join Date
    Feb 2011
    Posts
    10

    Hide textboxes only on new record.

    Hi Experts, I'm trying to hide textboxes but only on the New Record that the form loads up on. i.e. when I go back to a previous record using the navigation buttons on the form footer the boxes should be set to visible. Below is what I’ve tried but is not working, it keeps the boxes invisible all the time.

    Set boxes invisible on load

    [/CODE]
    Code:
    Private Sub Form_Load()
        
        'Open the form at a new Record.
        DoCmd.GoToRecord , , acNewRec
        
        'Set Later steps to invisible on load
        If Me.NewRecord = True Then
        Text20.Visible = False
        Text67.Visible = False
        Text71.Visible = False
        Command1.Visible = False
        Command105.Visible = False
        End If
    End Sub


    Navigate to another set to visible

    Code:
    Private Sub Form_GotFocus()
        If Me.NewRecord = False Then
        Text20.Visible = True
        Text67.Visible = True
        Text71.Visible = True
        Command1.Visible = True
        Command105.Visible = True
        End If
    End Sub




    I'm sure this can't be as difficult as I’m making.

    Any advice appreciated

  2. #2
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    you can probably do it using the forms "oncurrent" event. check for a new record on that one, and it should work fine.

  3. #3
    SRSA is offline Novice
    Windows XP Access 2003
    Join Date
    Feb 2011
    Posts
    10
    worked a treat,

    Thank you......

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

Similar Threads

  1. #Name? errors with textboxes
    By jasonbarnes in forum Forms
    Replies: 3
    Last Post: 12-16-2010, 09:51 AM
  2. Replies: 3
    Last Post: 09-15-2010, 01:04 PM
  3. Having trouble dealing with these textboxes
    By blacksaibot in forum Programming
    Replies: 2
    Last Post: 04-28-2010, 12:10 PM
  4. subform comboboxes/Textboxes
    By terryvanduzee in forum Forms
    Replies: 2
    Last Post: 11-19-2009, 07:41 PM
  5. Get average of unbound textboxes.
    By markhook in forum Forms
    Replies: 8
    Last Post: 07-14-2006, 09:30 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