?
Solved

Open popup but keep MS Access minimised

Posted on 2012-08-17
14
Medium Priority
?
584 Views
Last Modified: 2012-08-21
Is there any way I can set up a minimised MS Application so that if the user selects it, the popup window it displays (that's all it will every display) appears on the screen but the MS Access backdrop automatically minimises itslef again?
0
Comment
Question by:Rob4077
  • 6
  • 5
  • 3
14 Comments
 
LVL 13

Expert Comment

by:Ryan
ID: 38307322
doCmd.RunCommand acCmdAppMinimize in Form_Load (or Form_Open) event of the first form that opens.
0
 

Author Comment

by:Rob4077
ID: 38307350
Hi MrBullWinkle. Thanks for the suggestion, it's close to what I am hoping but not quite. Here's the background:

I have a parent MDB that provides a user interface, and ensures one instance of a child MDB (a separate program) is always running. The child app has a popup that alerts the user what it's doing if they're interested. When the child app is launched by the parent app it is launched completely minimised. That all works well.

What I want is IF the user clicks on the child app on the task bar the app will maximise momentarily but then immediately minimise everything except the popup. All the user needs to see is the popup. Thinking about it, that may not be very useful anyway because it will then always be on top and can no longer be minimised - am I right?
0
 
LVL 13

Expert Comment

by:Ryan
ID: 38308040
Do you mean hide all applications, like pressing Windows+D? I can't seem to find that command in VBA, but I think that would annoy me as a user, and I don't know why you would want that.  Typically you would just open the application in full screen for that effect.
0
Granular recovery for Microsoft Exchange

With Veeam Explorer for Microsoft Exchange you can choose the Exchange Servers and restore points you’re interested in, and Veeam Explorer will present the contents of those mailbox stores for browsing, searching and exporting.

 

Author Comment

by:Rob4077
ID: 38308586
This child program's job is to read emails and load them into an Access table. I would have liked to include the process into a timer event on the main program but the process can take some minutes to complete if there are a lot of emails to read and MS Access doesn't give me the flexibility to run it a separate thread so I have to run it in a separate instance of Access.

The only thing the user will see if they select the child app from the system tray is a small popup window that says the name of the program, the last time the app was run and possibly a tag that says "Reading emails" if the timer event is running.

I was hoping there may be a way to set it up so that if the user selects the child app from the system tray, only the popup will appear, not the whole MS Access desktop. It sounds like I am asking the impossible from MS Access.
0
 
LVL 13

Expert Comment

by:Ryan
ID: 38308595
I'm not saying it's not possible, but you're certainly getting into territory that would be better suited for a stand alone app, like .NET and run as a scheduled task.  Both in letting you use threadding, and also allowing you to utilize the systray features of windows.

You've made Access do it, but you're probably going to have to compromise a bit.  Maybe another expert will  be able to offer something else for you that I'm not considering.
0
 

Author Comment

by:Rob4077
ID: 38308634
Truth is I wish I could have developed this as a.NET application but I don't have the skills. I tried to learn .NET a while ago but could not figure out how to create and process a recordset like I do regularly in VBA so I gave up.

I will leave this question open for a little longer in case another user can provide a solution. Otherwise I will have to be satisfied with just removing the Access ribbon.
0
 
LVL 58

Accepted Solution

by:
Jim Dettman (Microsoft MVP/ EE MVE) earned 2000 total points
ID: 38309491
<<I was hoping there may be a way to set it up so that if the user selects the child app from the system tray, only the popup will appear, not the whole MS Access desktop. It sounds like I am asking the impossible from MS Access. >>

You can hide the main Access Window.  See:

http://access.mvps.org/access/api/api0019.htm

Jim.
0
 

Author Comment

by:Rob4077
ID: 38310258
Thanks Jim, that sounds like it may be the best solution.

MrBullwinkle, I have to say that your solution of writing it in VB.Net is probably a more sensible solution but I have too much to learn in a short space of time to accomplish that. I have an opportunity here to develop a small program for a niche market and time is of the essence. I will probably raise a question somewhere to seek suggestions as to what alternative language I should devote my energies to learning as an alternative to MS Access. It seems like I am finding more an more limitations in MS Access lately.

BTW Jim, I need to thank you for another solution that capricorn1 pointed me to in another question. I was looking for a way to make sure that a second application was opened but only once and he pointed me to your article on using a Mutex. I modified the code so that the parent app checks for the Mutex and only launches the child if the mutex isn't there instead of launching the child and having it close itself if it's already open. It works brilliantly. Thanks
0
 
LVL 58
ID: 38311285
<<Thanks Jim, that sounds like it may be the best solution.>>

 I only tried the code once, so I know it works, but I've never used it in a production project.  Should do the job for you though.

<<BTW Jim, I need to thank you for another solution that capricorn1 pointed me to in another question. I was looking for a way to make sure that a second application was opened but only once and he pointed me to your article on using a Mutex. I modified the code so that the parent app checks for the Mutex and only launches the child if the mutex isn't there instead of launching the child and having it close itself if it's already open. It works brilliantly. Thanks >>

   I saw the thread and didn't comment because that was the code I was referring to in the previous thread.  I have a slight variation of that (CheckIfAppUp()) which is more what I was thinking of, but sounded like you were already there, so I didn't bother to post.

  The mutex object works pretty slick and best of all, it disappears on a reboot, which results in less support calls.

 Glad you found it useful.

Jim.
0
 
LVL 13

Expert Comment

by:Ryan
ID: 38311530
Rob, before you ask about another language, I would search on here first for those kinds of questions. The answer will almost always depend on the situation. I know the same question came up last week about moving from Access to something else.  I feel your pain in getting too complex for Access, but not having time to learn a new language. I was there a few years back.

In all honesty, don't think you have to abandon Access all together, just know that it's somewhat limited to "simpler" things, but you can develop some moderately sophisticated apps much quicker in Access than .NET
0
 

Author Comment

by:Rob4077
ID: 38314301
Jim, You know the project I am working on and the reason I needed the code to hide everything but the popup. The user needs to do nothing but know this "thread" is running. Your code should do the tick as long as I can be certain my error traps work. I may need to add a button or another control to minimise the popup.

The mutex code was easy to modify to suit my needs once I figured out that process B could read the mutex created by process A. It also means I don't need to have a vbs process running to keep things running - I already have too many things running.

MrBullwinkle, thanks for your comments on an alternative to MS Access. I have run into the need for multiple threads in many of the projects I have worked on and always found a solution, but it's always been messy running a second instance of MS Access or some vbs code just to run a small background process. In addition to that I see that MS Access 2010 has expanded it's functionality mainly in macros not VBA so MS clearly see it as evolving as a product for relatively low complexity tasks. As a result I haven't even bought 2010.

I have ventured into VB.Net and liked what I learned but all the training videos I saw showed me how to manage a form and records linked to a form but I could not figure out how to do background processing with a recordset. I asked some questions on EE but could not get the support I needed. Not that I am critical of the experts, it's understandable that they expect users to have a basic level of understanding before pitching in and helping and I just didn't have that basic level.

What it means is I need to figure out what language is the most logical progression for me to go to next. I then need to buy a good book on the subject and do some serious reading. Or I need to find a "beginner to advanced user" training resource on the net for whatever I go to next. It sounds like VB.Net or maybe C#.Net may be the best options for me. And the bonus is they're free. However I don't know if the resources they provide for free make it viable or if they're just enough to make me realise I need to spend bag loads of money buying full featured versions of the software.
0
 
LVL 58
ID: 38315742
VB.net is the logical choice.  It's cloest to VBA and will seem the most familer.  But your right, even with that, it's not something your going to be instantly productive with and will take some time to get to.

I would suggest sticking with Access for your current projet, but long term, looking to VB.net would be a good idea.

Jim.
0
 
LVL 13

Expert Comment

by:Ryan
ID: 38315850
Agree with Jim.  Don't necessarily constrain yourself to learning from books, either.  I was a VBA programmer before I had any college classes on the subject, learned it all from Macro recording and google searches (sites like this and example codes like on CodeProject), as I also had no friends or coworkers to ask.  College taught me some patterns and logic to employ, a little C and java, but not all that much syntax.

When jumping from VBA to .NET, the biggest hurdle I had was DataGridViews.  They're the cornerstone of displaying recordsets.  Essentially they're the do it all table in .NET  

DataTables/DataReaders are the replacements for VBA Recordsets. Most everything else is pretty straightforward, as I recall.  

Embrace Option Explicit and Option Strict. It adds overhead of having to code a little more deliberately, but it'll save you time dealing with hidden/random errors as the compiler will not have to make very many assumptions.

Start little to avoid being overwhelmed, a systray hidden process would probably be an easy project to try.
0
 

Author Comment

by:Rob4077
ID: 38316421
Thanks for the additional insights.

Like you I learned what I know about VBA from books, internet and EE. I should go to classes and learn a little more about .NET so I can start working with it.

Phase 1 of the project I am undertaking now is almost finished. Once I get it out in the field I will look at refinements and I will take up your suggestion of trying to make the systray hidden process my first project and see how I go.

Thanks again
0

Featured Post

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
Instead of error trapping or hard-coding for non-updateable fields when using QODBC, let VBA automatically disable them when forms open. This way, users can view but not change the data. Part 1 explained how to use schema tables to do this. Part 2 h…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question