Results 1 to 4 of 4
  1. #1
    sgtclark is offline Novice
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2020
    Posts
    24

    Hide/Unhide Text Box ON Load and ON Dirty

    Ok guys I have this mostly working with one small glitch and I am sure its easy but I have been looking at it for to long to see the issue.



    I have a form with a text box named [PH] (properties set to not visible)……. a combo box named [CS Multiple Phases List] (properties set to not visible)……….. and a check box named [CS Multiple Phases]

    What I want it to do I when the check box is not checked show the [PH] thus [CS Multiple Phases List] is still hidden, when it is checked the [CS Multiple Phases List] is shown and thus the [PH] is hidden.

    The users make he check box selection on the form.

    Currently when opened it works perfectly rather the box has been checked before or if it is blank.

    The problem is when the check box is selected you must unselect and select it again before the fields hide and unhide as they should.

    Here is the code, please show me what I am overlooking.

    Code:
    OptionCompare Database
    
    Private SubForm_Current()
    
    [CSMultiple Phases List].Visible = Me.[CS Multiple Phases] = True
    
    [PH].Visible= Me.[CS Multiple Phases] = False
    
    [CS Status]= "New Request"
    
    
    End Sub
    
    Private SubForm_Dirty(Cancel As Integer)
    
    [CSMultiple Phases List].Visible = Me.[CS Multiple Phases] = True
    
    [PH].Visible= Me.[CS Multiple Phases] = False
    
    Me.Refresh
    
    End Sub 
    .

  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,518
    I would try the after update event of the checkbox rather than the dirty event.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    sgtclark is offline Novice
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2020
    Posts
    24
    Yep that works. I knew it would be easy, but I thought I had tried that already. Thank You

  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,518
    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. Hide and Unhide forms
    By Paul H in forum Forms
    Replies: 5
    Last Post: 10-16-2019, 10:07 AM
  2. Hide and unhide arrows
    By tarhim47 in forum Programming
    Replies: 1
    Last Post: 09-20-2011, 07:54 PM
  3. Hide or Unhide Fields in Query using VB
    By SCFM in forum Programming
    Replies: 4
    Last Post: 03-12-2010, 01:24 PM
  4. How can I hide/unhide DB window with a single button?
    By aquaraider in forum Programming
    Replies: 2
    Last Post: 10-09-2009, 07:01 AM
  5. Hide/UnHide forms
    By access in forum Forms
    Replies: 3
    Last Post: 06-03-2009, 07:48 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