Results 1 to 4 of 4
  1. #1
    mrt1069 is offline Novice
    Windows 10 Access 2016
    Join Date
    May 2016
    Location
    Alabama
    Posts
    9

    Resetting visiblity settings on new record

    Hello everyone.

    Just a minute ago I set up a form where I have a check box (chk1) and two text boxes (txt1 and txt2)

    I wanted the text boxes to only display if chk1 was checked off so I put an on-click event on chk1:

    If chk1 = true then
    txt1.visible = true
    txt2.visible = true
    else
    txt1.visible = false
    txt2.visible = false
    end if

    I thought it would be OK until I checked something off and then opened a new record. Although nothing had been checked off, the two text boxes were still there.
    I realize now that the who .visible property is going to change all of the forms, rather than just the one I am on.
    Is there a way I can do things differently or put in an event to run when the new record opens in order to change the visibility settings to reflect the boxes that are/are not checked?

    Thanks for the help =)

  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
    Try the same code in the current event of the form.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    mrt1069 is offline Novice
    Windows 10 Access 2016
    Join Date
    May 2016
    Location
    Alabama
    Posts
    9
    That did the trick!

    What an easy fix.

    Thanks!

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Happy to help!
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Replies: 2
    Last Post: 06-25-2015, 10:08 PM
  2. Resetting form to original status on record change
    By Thompyt in forum Programming
    Replies: 8
    Last Post: 11-18-2014, 08:09 PM
  3. Replies: 2
    Last Post: 05-21-2014, 09:46 AM
  4. Replies: 5
    Last Post: 03-14-2013, 01:52 PM
  5. Resetting Record Source on Form
    By Cheshire101 in forum Programming
    Replies: 5
    Last Post: 05-05-2011, 08:52 AM

Tags for this Thread

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