Switch form shown within navigation tab (MS Access 2016) - vba

I've been spending a while learning access and I have a question that may or maynot be possible. Ive written code that moves between access forms by running queries, opening a new form and then closing the old one (with a back button on the new page to close down the form and re-open the old one) so that people can navigate between different pages.
However, I am now trying out a navigation pane and wonder if there is a way to switch the form shown within the navigation pane tab so that different panes have different forms that can be switched between quickly?

Related

ReportViewer 15.0.0.0 vertical scroll on opening a sub record

We have an MVC web application, and recently we migrated from Microsoft ReportViewer from 11.0.0.0 to 15.0.0.0 version.
We started having different issues in terms of UI, one of which is mentioned as below.
When we run the report from SSRS (SQL Server 2016), and click on the plus icon used to open the sub record (inner record), the vertical scroll bar maintains position and we can see the data clearly, as shown in below image
However, when the same report is run from MVC web application, using ReportViewer control, when we click on the plus button the scrollbar scrolls to the expanded icon and it does not gives good look and feel to end user. Sometimes the scroll even hide half of the current record. E.g. below is the screenshot when we run report from MVC web application using ReportViewer control. 1st image shows before clicking on the plus icon, and 2nd image shows after clicking on the plus icon.
Image-1
Image-2
Has anyone come across such situation? How can I avoid such scrolling on opening a sub record ?
Following is code I have used in .aspx file of which uses ReportViewer control

How to keep MS Access Forms only in the MS Access Window/Canvas?

I have created my MS Access Program but I have multiple monitors and so do the other people who will be using the program.
Just so you know my forms are popup style, have no borders or record selectors and I am guessing this is where my issue comes in.
I would like to know if there is a way to ensure that when a user opens a form, the form will only open within the MS Access Window/Canvas on the active monitor?
I would also like to know if there is a way for my application to automatically adjust according to the users screen resolution?
As an example my Forms open perfectly when I am using the application on my main screen which has a resolution of 3840 x 2160 but if I open the application on my second screen which has a resolution of 1920 x 1080 the forms that open subsequently, such as the user form, then opens on the main screen so small that no one can read or see it.
Application is on Right monitor and User Form is Open on Left (Main) Monitor
The code I have used for the OnOpen Event is below:
Private Sub Form_Open(Cancel As Integer)
Dim Right As Integer, Down As Integer
Right = Screen.ActiveForm.WindowLeft
Down = Screen.ActiveForm.WindowTop
DoCmd.MoveSize Right, Down
End Sub
This was obtained from some research but I cant seem to bind everything to the Application Window/Canvas.
Thank you.
Well, if you only ever have one window open at one time, then you can do this with ease.
Remember, today most applications are SPA (what we call single page applications). We don't use (nor have) very often a main applcation window, and THEN a child window. For one, they tend to not be touch friendly, and it is VERY hard to move a window around with touch.
but, even desktop browsers even use some "kind" of tabbed interface. And so do most desktop applications. And by tabbed - I don't necessary mean across the top. This access screen shows a tab system from the left side:
So, Access now has a option to use tabbed interface.
And if you :
do NOT use pop windows.
Set access to use tabbed interface, eg this:
Then un-check the display tabs.
If you do above, then you WILL NEVER EVER see the access background window.
You see this:
However, keep this in mind:
The form you launch will re-size to the main size of the Access window - not the other way around.
All forms can't be popup
You are "SPA" like applcation.
So, most accounting and most desktop applications now work this way. And WHEN you launch a form, the window does not re-size tot he form, but remains the current applcation window size.
So, without ANY specials code, you can 100% hide the access background window.
And if you re-size the access application window, then the form will re-size to fill out the current form.
This might look quite bad in some cases - such as this:
Now for above, I on purpose made the form background green - just to PROVE and show that that Access background window NEVER will display with above options.
So, the main issue here?
You can 100% hide the access background window. And you can now do this WITHOUT specials code. Just a few settings.
On startup, you can hide the ribbon - or build a custom one - again your choice.
But, your forms MUST NOT be popup forms anymore.
So, hiding the access background window is very easy - it then becomes a question of form size - size forms re-size to application window size - not the other way around.
On the other hand, if you adopt a tabbed interface (accross the top or left side), then your main window is always in display, and you are in effect swapping out the form (a sub form) for display of that given form. You can write your own code, or use a new navigation form - which does this for you).
If you need to launch separate windows, then you could launch them as popup from this main form - but that main form will of course always hide the access background if you follow above.
If you wish to hide the ribbon, then on your main form - load event, you can add this code:
DoCmd.ShowToolbar "Ribbon", acToolbarNo
So, your main form (which hides access background) could be tabbed inteface (SPA) or it could be a launcher form, and each option clicked on could launch a form as popup - which can be dragged anywhere on your computer - including to the 2nd monitor if you wish.
So, either forms stay always in the main applcation window - but never see the background. Or you use above, and launch forms as popup.

Make a VBA form appear in windows task bar

I am programming a little application (an overgrown macro really) in Visual Basic for Applications in Office 365. What it does is:
Displays one window that has a few input fields.
Once I fill out those fields with data I can press a button on the form and a summary in a nice graphical form is displayed in a second window (a second form is displayed using UserForm2.show).
The second user form can be updated with new data by typing in updated text in first form and updating the second form by pressing a button on the first form (in the form of UserForm2.TextField1.Text = UserForm1.Label1.Text.
Both forms are modeless so the user can work in Outlook whilst the forms are running.
All works fine except one caveat:
Both forms are not visible on the Windows Taskbar, in the Task Manager, but most importantly they are not visible as separate windows to teleconferencing software we are using. And this is the macro's sole purpose.
Question: Is it possible to make the entire macro (or just UserForm2) run as if it was a separate application, so it appears in the Task Bar as a separate window, and not an internal form running inside Outlook?
The idea is not to run it independently of Outlook (or Excel), but to make them visible to external programs.
I tried a few options available on the Internet, but none of them work, and honestly I do not know where to begin, or how to circumvent it if it is not possible to do directly within the available API. Can you advise?

Dont hide a menu/menuitem on click

I am using vb.net and don't want to use WPF.
I have a menustrip having many menus.
These menus have many menuItems.
When I click on any menuItem I show a new form to the user.
When user finish his work and return to the main form he should be able to see the menu as it was while he left the main form.
I mean when I click on a menuItem the menu closes. But I don't want it to close.
It will likely be more confusing for your users having a menu that never closes because it defies expected behaviour. You are better off using one of the other controls suggested.
Every Operating System (Windows, Mac etc) define a standard set of controls for a reason - to enforce consistency and predictability across multiple applications. It's why you know to look to the menu to find a command. Microsoft, Apple etc all produce "design standards" documents that specify a baseline for the way that your user interacts with your app.
If a user selects something from the menu and the menu never closes, the user could well think that your application is broken.

Flickering Task Bar on Full Screen Windows Mobile 6 Apps

Just finishing off an update to an application written in VB.NET that used to run fine under CE.NET 4.2. Deployment platform is now Windows Mobile 6.1.
The application runs in full screen, however whenever a new form is opened, the task bar, i.e. the bar with the start button comes to the fore and then the new form takes over. This is particularly annoying as I have a form that has many sub forms which are 128,128 and still the task bar flashes and obscures part of the user input screen.
Has anyone comes across this? Any known workarounds?
You can use the technique I posted here to disable the task bar.
I assume your application flow is something like:
Form 1 open.
Form 1 close.
Form 2 open.
The problem is that between the Form 1 closing and the Form 2 opening the background window may be partially drawn (e.g. the task bar will draw).
To work around this we normally create a parent window (which is your case is full-screen window) which sits behind the form windows. That way when one is closing and the next is opening it falls back to displaying the parent window which can display anything you like (blank?).