Results 1 to 3 of 3
  1. #1
    Ruegen's Avatar
    Ruegen is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Australia
    Posts
    1,496

    Hide show buttons on iff


    I'm stuck on something.

    I have two buttons.

    One button puts in a date() in a [Removed] textbox called btnRemoveSchool
    One button removed date() with null called btnReinstateSchool

    I want each button to hide each other when clicked (visible)

    When I put the VBA me.btnremoveSchool.visible = false
    I get error because it has focus.

    I also want the page to load on whether it has null or not.

    I thought of doing on page load if
    iff [Removed] = Not Null
    then
    me.btnRemoveSchool.visible = false

    and so on.

  2. #2
    Ruegen's Avatar
    Ruegen is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Australia
    Posts
    1,496
    This works for the loading

    Code:
    Private Sub Form_Load()If Not IsNull(Me.Removed) Then Me.btnRemoveSchool.Visible = False
    If IsNull(Me.Removed) Then Me.btnReinstateSchool.Visible = False
    
    
    If Not IsNull(Me.Removed) Then Me.btnReinstateSchool.Visible = True
    If IsNull(Me.Removed) Then Me.btnRemoveSchool.Visible = True
    End Sub
    However clicking the buttons to enter in null or Date() and then making them visible accordingly still is my problem

    and this gets them making them visible
    Code:
    Private Sub btnReinstateSchool_Click()
    Me.Removed = Null
    Me.btnRemoveSchool.Visible = True
    End Sub
    
    
    Private Sub btnRemoveSchool_Click()
    Me.Removed = Date
    Me.btnReinstateSchool.Visible = True
    End Sub
    I thought about using after update on the [remove] field but with no luck (in order to hide the buttons with an if)

  3. #3
    Ruegen's Avatar
    Ruegen is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Australia
    Posts
    1,496
    eh sorted it with this

    Code:
    Private Sub btnReinstateSchool_Click()Me.Removed = Null
    Me.btnRemoveSchool.Visible = True
    
    
    DoEvents
    Me.btnRemoveSchool.SetFocus
    DoEvents
    Me.btnReinstateSchool.Visible = False
    
    
    End Sub
    
    
    
    
    
    
    Private Sub btnRemoveSchool_Click()
    Me.Removed = Date
    Me.btnReinstateSchool.Visible = True
    
    
    DoEvents
    Me.btnReinstateSchool.SetFocus
    DoEvents
    Me.btnRemoveSchool.Visible = False
    
    
    
    
    End Sub
    
    
    Private Sub Form_Load()
    If Not IsNull(Me.Removed) Then Me.btnRemoveSchool.Visible = False
    If IsNull(Me.Removed) Then Me.btnReinstateSchool.Visible = False
    
    
    If Not IsNull(Me.Removed) Then Me.btnReinstateSchool.Visible = True
    If IsNull(Me.Removed) Then Me.btnRemoveSchool.Visible = True
    End Sub

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

Similar Threads

  1. Hide Show Text Box
    By Derrick T. Davidson in forum Forms
    Replies: 3
    Last Post: 04-09-2013, 11:13 PM
  2. GUI buttons to show reports?
    By brownk in forum Access
    Replies: 2
    Last Post: 05-15-2012, 08:59 AM
  3. Show/Hide Form
    By sparlaman in forum Forms
    Replies: 5
    Last Post: 05-16-2011, 11:48 AM
  4. Hide and show tekstbox
    By Patience in forum Access
    Replies: 3
    Last Post: 06-18-2010, 06:15 AM
  5. Show/Hide Columns in a Query
    By SCFM in forum Access
    Replies: 1
    Last Post: 02-23-2010, 08:04 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