Results 1 to 6 of 6
  1. #1
    Derrick T. Davidson is offline Competent Performer
    Windows 8 Access 2010 64bit
    Join Date
    Mar 2013
    Posts
    142

    Hide Button in sub form view

    I have a form [frmTransactions] which contains a sub from [frmSubTransacions] the sub form has several buttons.



    I would like to hide a button in the sub form when viewed in the Main form, and display the button when viewed as a form.


    i.e.
    "open sub form"
    [btn1] visible true

    open main form containing sub form
    [btn1] visible false

    Is this possible??

  2. #2
    Derrick T. Davidson is offline Competent Performer
    Windows 8 Access 2010 64bit
    Join Date
    Mar 2013
    Posts
    142
    I tried this but I get an error
    Code:
     Forms![frmTransactions]![frmSubTransaction].Form![btnClose].Visible = False

  3. #3
    Derrick T. Davidson is offline Competent Performer
    Windows 8 Access 2010 64bit
    Join Date
    Mar 2013
    Posts
    142
    Got it working now ("naming issue" but it hides the button in both views?

    i.e. it is hidden when I open [frmSubTransaction] (Which I don't want) as well as when I view it as a sub form in [frmtransactions] (Which is what I want)

  4. #4
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,016
    If I understand you, correctly:
    Code:
    Private Sub Form_Load()
      If SysCmd(acSysCmdGetObjectState, acForm, "frmSubTransacions") = 0 Then
       'Opened as Subform...Code to HIDE the buttons goes here
     Else
       'Opened Independently... Code to SHOW the buttons goes here
     End If
    End Sub

    Linq ;0)>
    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  5. #5
    Derrick T. Davidson is offline Competent Performer
    Windows 8 Access 2010 64bit
    Join Date
    Mar 2013
    Posts
    142
    Cool thank you so much

  6. #6
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,016
    Glad we could help!

    Linq ;0)>
    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

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

Similar Threads

  1. Simple Hide and View Button Issue
    By tsgtnissen in forum Programming
    Replies: 10
    Last Post: 02-16-2015, 12:58 PM
  2. Replies: 4
    Last Post: 11-21-2014, 09:56 PM
  3. Replies: 1
    Last Post: 09-27-2013, 12:49 PM
  4. Replies: 3
    Last Post: 05-02-2012, 10:13 AM
  5. Hide records from Form View
    By Douglasrac in forum Forms
    Replies: 9
    Last Post: 05-13-2011, 11:55 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