Results 1 to 11 of 11
  1. #1
    .:SoundWave:. is offline Novice
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Dec 2010
    Posts
    11

    Subform button to make mainform's navigation controls Visible

    I have a navigation form and a subform. When the navigation form (frmMain) is first opened, the navigation control (NavigationControl0) isn't Visible. On the subform (frmMakeVis) that loads, there's a button that when clicked is supposed to set NavigatioControl0 to Visible using a Macro. Unfortunately, every time the button is clicked it tells me that the control name is misspelled or doesn't exist.

    This is the OnClick event of the button:

    SetProperty
    Control Name: [Forms]![frmMain].[Form]![NavigationControl0]
    Property: Visible
    Value: 1



    I'd be grateful if someone could point out my mistake.

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    You said the Navigation control is on the MainForm right?
    Try: Control Name: [Forms].[frmMain].[NavigationControl0]

  3. #3
    .:SoundWave:. is offline Novice
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Dec 2010
    Posts
    11
    Quote Originally Posted by RuralGuy View Post
    You said the Navigation control is on the MainForm right?
    Right!

    Quote Originally Posted by RuralGuy View Post
    Try: Control Name: [Forms].[frmMain].[NavigationControl0]
    I'm still getting the same error. This is driving me nuts.

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Put the same control on the MainForm and see if it works. I would think you would want to set the value to -1 rather than 1. I do not use macro's so I'm a little out of my element here.

  5. #5
    .:SoundWave:. is offline Novice
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Dec 2010
    Posts
    11
    Quote Originally Posted by RuralGuy View Post
    Put the same control on the MainForm and see if it works. I would think you would want to set the value to -1 rather than 1. I do not use macro's so I'm a little out of my element here.
    First, thanks for pointing out that the "1" should have been a "-1". That's fixed now.

    I'm assuming you meant to move the button to the mainform when you said 'control', since the control that I'm trying to turn Visible is already on the mainform. After moving the button to the mainform, I still get the same error message. There has to be something I'm doing wrong somewhere. I keep hoping it's a typo I'm making, but I've checked and re-checked the names of the form, the control, and my spelling in the Macro itself.

  6. #6
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Well to start, a CommandButton *is* a control but I should have been more explicit. Oh wait, the NavigationControl is new to ac2010 so maybe it is referenced differently. Maybe you can post a sample db I can play with using code.

  7. #7
    .:SoundWave:. is offline Novice
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Dec 2010
    Posts
    11
    Quote Originally Posted by RuralGuy View Post
    Well to start, a CommandButton *is* a control but I should have been more explicit. Oh wait, the NavigationControl is new to ac2010 so maybe it is referenced differently. Maybe you can post a sample db I can play with using code.
    Hmm. I can't seem to upload it as it exceeds the filesize limits. It's not very fancy though, as I tend to make db's specifically to try new things. It's literally two forms: Navigation Form (frmName), the form with the button (frmMakeVis). frmMakeVis has a single button on it (btnVisTest).

    On frmMain, NavigationControl0's Visible property is set to NO. On frmMakeVis, btnVisTest's OnClick macro contains only:

    SetProperty
    Control Name: [Form].[frmMain].[NavigationControl0]
    Property: Visible
    Value: -1

    Not really sure why a DB with only two forms comes out to 764kb, but it should only take a couple of seconds for you to remake it if you're still interested.

  8. #8
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Compact and Repair the accdb and then zip it up first. It should then upload just fine.

  9. #9
    pkstormy's Avatar
    pkstormy is offline Access/SQL Server Expert
    Windows XP Access 2003
    Join Date
    Mar 2010
    Location
    Madison
    Posts
    682
    Do you mean?

    Forms!MyMainFormName.NavigationButtons = True

    to make the Navigation buttons visible on the MyMainFormName. Not sure what it would be in a macro but you could easily put this vba code in your button's Onclick event.

  10. #10
    .:SoundWave:. is offline Novice
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Dec 2010
    Posts
    11
    Just so no one's left hanging, I've since abandoned this idea. Maybe I'll come back to it in the future, but it was more of a neat thing to try out than an essential requirement for any database I was working on. Thanks for all the input though!

  11. #11
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Happy New Year. Thanks for posting back.

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

Similar Threads

  1. How can I make a label a button?
    By BrainKing in forum Forms
    Replies: 6
    Last Post: 10-31-2010, 01:52 PM
  2. Replies: 1
    Last Post: 09-27-2010, 04:27 AM
  3. Replies: 3
    Last Post: 10-18-2009, 09:17 AM
  4. Replies: 1
    Last Post: 09-28-2009, 05:21 PM
  5. subform controls hidden
    By bkelly in forum Forms
    Replies: 0
    Last Post: 09-26-2009, 10:12 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