On startup I want to check whether the navigation pane (left side of the screen) is open so I can minimize it by simulating a keypress. I managed to do it for the ribbon (top of the screen) by using the method CommandBars("Ribbon").Height.
I want to do the same thing for the navigation pane. There is a CommandBars(index).Width method so I think it should be possible.
I tried getting all the names of all the controlbars but I can't manage to find the correct one. I also tried to compare the width of all controlsbars which name contain "nav" using this code
For Each cb In CommandBars
If (InStr(cb.Name, "nav")) Then
Debug.Print cb.Name & vbTab & cb.Width
End If
Next cb
I ran this code with both the pane opened and closed but I havent been able to find any differences in width.
Does anyone know how I get the correct width of the navigation pane in Access 2007?
There's this option: SendKeys ("{F11}"). The only catch is knowing if it's already open or not.
This works for some, not others (works on my machine...access 2016):
DoCmd.NavigateTo "acNavigationCategoryObjectType"
DoCmd.Minimize
There's more discussion here: social.msdn
Related
Is it possible to somehow have way for the Selection.Style (and possibly other info) to always show up in a custom information window similar to the way Debug.Print prints in the immediate windows but ALWAYS visible?
I find myself struggling to quickly check a Selection.Style. MsgBox requires clicking "OK".
I have used the "Reveal Formatting" window but I would like more control over how the information displays.
Is this possible?
At least for knowing the Style at the current selection point, you don't need a custom user form. Place the StyleGalleryClassic control on the QAT or a Ribbon tab.
I have tried to maximize my access form with
DoCmd.Maximize
But when I double click, I can see the form not getting FULLY maximized for the ENTIRE screen.
The 'Tables-queries' pane on the left side is hiding the entire view.
I tried opening some of the sample access forms downloaded from web, they all opened in full screen . Some one please help me.
For Maximize to be effective you first have to change the Access option to allow Overlapping Windows. Then the form itself must be the active object. One way to activate the form is:
DoCmd.SelectObject acForm, "frmName"
You can minimize the Navigation Pane (on the left) with:
DoCmd.NavigateTo "acNavigationCategoryObjectType"
DoCmd.Minimize
You can minimize the Ribbon with:
DoCmd.ShowToolbar "Ribbon", acToolbarNo
'to show it..
'DoCmd.ShowToolbar "Ribbon", acToolbarYes
The form will occupy the remaining space - the maximimum amount available to it. it won't occupy the ENTIRE screen.
(Below answer is not for regular behavior. When a form modal property is set to "yes" or true, you have to type one statement outside a form to solve your problem)
If you call a form using:
Docmd.openform "yourFormName"
Right after those statement type again:
Docmd.maximize
Enjoy!
Needing some help attaching an Excel/VBA button on an Excel sheet. I need it to stay in the same position on the screen regardless of how I scroll or zoom. Preferably, I need this on the bottom left or right of the screen.
I have tried adding a button. Then, I right clicked on the button. Clicked on Format Controls -> Properties -> selected Don't Move or Size With Cells. Am I missing something that's making this not work?
Thanks!
I know this post is old, but here's to anyone it could be useful. The VisibleRange property of ActiveWindow can solve this problem. Use something like this:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
With ActiveSheet.OLEObjects("MY_BUTTON'S_NAME")
.Top = ActiveWindow.VisibleRange.Top + ActiveWindow.VisibleRange.Height - 5
.Left = ActiveWindow.VisibleRange.Left + ActiveWindow.VisibleRange.Width - .Width - 5
End With
End Sub
Here is the idea that I put across the comment earlier today :) Typically we can get a Floating User Form by setting the Modal property of the form to be 0 which is indeed a Modeless state.
Basic Points to consider:
Look & Feel of the form to make it look like a Button (Not show title bar/Not Resizable/
Hidden Close Button etc)
Setting the position of the Button
Which Event should trigger the form-button (WorkBook Open)
What would you do with Form Initialize Event
Whcih Events should keep it stick to the same position alive
Further Points to consider:
You might only want to keep this button vissible for the workbook you are working, and if you open another instance of a workbook, do you still want to keep the button
If you minimize the Excel Window instance, how do you plan to manage the state of the button and keep it visible
Post about keep displaying a form even the workbook is minimized.
One other great reference I happend to see, (little bit technical) but worth the shot - at least to get to know the certain properties/methods that you could make use: Extending VBA User Form Control.
The article include the following info, and please note the last line as well :)
They give you access to capabilities that are not available from VBA or from the objects (UserForms, Workbooks, etc.,) that make up a VBA Project. When you call an API, you are bypassing VBA and calling directly upon Windows. This means that you do not get the safety mechanisms such as type checking that VBA normally provides. If you pass an invalid value to an API or (a very common mistake) use a ByRef parameter instead of a ByVal parameter, you will most likely completely and immediately crash Excel and you will lose all your unsaved work. I recommend that until you are confident that your API calls are solid you save your work before calling an API function.
Add new Row on the beginning of your WorkSheet and set your button on it, then:
Freeze Top Row
Right click → properties → placement → change to 3.
I'm using Visual Studio 2012 to make a Vb.Net application.
In short, I added DotNetBar RibbonControl with some RibbonItems on it as my menu.
What happened is one of my tab is suddenly missing along with all the buttons in it.
I have searched for it on my Document Outline still no luck.
But what even more odd is, when I tried to recreate it with the same name, it shows an Alert "Property value is not valid" with message "The name AppPOButton is already in use by another component".
When I checked it on the form's Designer I do found this lines:
Me.AppPOButton = New DevComponents.DotNetBar.ButtonItem()
and
'AppPOButton
'
Me.AppPOButton.ButtonStyle = DevComponents.DotNetBar.eButtonStyle.ImageAndText
Me.AppPOButton.Image = Global.ProjectBMT.My.Resources.Resources.approval
Me.AppPOButton.ImageFixedSize = New System.Drawing.Size(40, 40)
Me.AppPOButton.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top
Me.AppPOButton.Name = "AppPOButton"
Me.AppPOButton.SubItemsExpandWidth = 14
Me.AppPOButton.Text = "Approve"
Me.AppPOButton.Visible = False
and
Friend WithEvents AppPOButton As DevComponents.DotNetBar.ButtonItem
Is there anyone can explain why this is happening?
Thank you
This behavior is weird itself, but it's not a problem actually, All the Ribbon style works on "Containers", if you check your ribbon control and click the left-upper button will see these little arrows that move four containers, these objects hold the buttons, images and other controls. Within your design window in the right panel (Properties) you can still see the names of the controls you "lost" when you deleted your tab, wich is also a container.
Steps:
Add a container within your design view and Dock it into the Ribbon control Form.
Click on the uppper right boton (Right Arrow) and select "Layout Ribbon", this will adjust the lenght and hight of the controls conatained.
Add the tab that will contain all the controls you have.
The fact that they are still in the designer form is the prove that they still exist, This behavior is just a glitch in the position and order of the controls set above your form ;-)
I resized my A2007 Navigation Pane and somehow closed it up so tight (maybe 8 mm) that I can't resize it again (can't grab the right margin....) The pane is open and operates, I can type a search into the pane's search bar, and it works, including opening the object I find. I just can't get it to resize so I can read it.
Any ideas?
Hit F11, to close the pane, then drag it out.
It is an infuriating problem!
Just ran into this problem with Access 2010 database saved in Access 2002 - 2003 format. Click F11 to collapse the Navigation Pane. Then select the edge of the collapsed navigation pane and drag to the right.
Just had this Navigation Pane problem in Access 2010... infuriating is an understatement. Lost an hour trying to figure it out... lost a form that wouldn't save in the process.
With a database open, goto: File/Options/Current Database/Navigation Options{button}/ De-select the "Show Search Bar".
Should be able to open the Database and expand the navigation pane, now.
Thanks.
All the answers did not work for me. This however worked.
Click on the Navigation pane title, "All Access Objects" in red. Change the objects you want to display. In my case I chose "Tables" from "All Access Objects". You can choose any.
Now drag the navigation pane out.
Change to the original display objects
Cheers.