Question Access 2007 Show Form on Top (1 Viewer)

mcclunyboy

Registered User.
Local time
Today, 00:07
Joined
Sep 8, 2009
Messages
292
Hi,

I have a button which runs some VB, it brings up various message boxes as it prints a report to file, runs a query etc etc. I am hoping to display a basic form, which simply covers most of the screen and states "Please Wait" or something. I have already built the please wait form (frm_please_wait) and have set it to pop up. I have added it to my VB to open before I run the queries/output to file however the messages still appear on top..

How can I force the form to display on top of everything else in access ( it is only visibly for a few seconds, depending on the spec of the pc).
 

James Dudden

Access VBA Developer
Local time
Today, 07:07
Joined
Aug 11, 2008
Messages
369
I'm not sure I understand why you would want a pop-up form over a message box. If you don't want to see the message box why have it pop-up in the first place?
(Sorry if not very helpful but I always like to try an understand the why first)
 

mcclunyboy

Registered User.
Local time
Today, 00:07
Joined
Sep 8, 2009
Messages
292
They aren't vb message boxes - the three things that pop up are:

1. Select Query (this just selects 1 record, the one being entered by the user
2. Report (produces a document based upon the new record)
3. Messages reporting the report is being output to file

I understand I can probably hide the Query and Report (although I don't know how), however I would like the Output To messages to be hidden, they flash up and it is disconcerting to my, fairly inexperienced with IT, users.

I am hoping that when the user clicks the button it pops up the frm_please_wait form, this dissapears when the various other parts complete.

It isn't the end of the world, I tried looking at modal forms but couldn't see how that would work.
 

James Dudden

Access VBA Developer
Local time
Today, 07:07
Joined
Aug 11, 2008
Messages
369
Turning the echo off and on may work as follows:

...Code that opens the pop up form here....

DoCmd.RunCommand Echo False

...Other code here.....

DoCmd.RunCommand Echo True


NB: I would put the True line just before you exit the sub within the error trap just in case there is a problem. This way it will alwys get set back to true so you won't get stuck with echo off.
 

mcclunyboy

Registered User.
Local time
Today, 00:07
Joined
Sep 8, 2009
Messages
292
Thanks, I tried switching the echo on and off and it didn't work. I have had a further look at a few different methods and I don't think it is easily possible so I may not worry about it.

I am using 2 commands, 1 to open the query and a second to close it - it doesn't display on my screen but I have a new(ish) PC. Is this the easiest way to "hide" it from the user? Or is there a way to run a select query without actually opening the datasheet view?
 

James Dudden

Access VBA Developer
Local time
Today, 07:07
Joined
Aug 11, 2008
Messages
369
By the sounds of it you don't need to see this query and there will be a way round it. Can you let me know exactly what the query is doing because above it says it just selects 1 record i.e. how/what is happening
 

mcclunyboy

Registered User.
Local time
Today, 00:07
Joined
Sep 8, 2009
Messages
292
The query simply selects the data from the form (using a form field as a parameter). It only selects 1 record as the parameter is the ID which is created when the user saves the record. This query is then used by a report (like a mail merge) to produce a document and output it to PDF.
 

James Dudden

Access VBA Developer
Local time
Today, 07:07
Joined
Aug 11, 2008
Messages
369
You shouldn't need to open the query to select the data if you filter the query by looking straight at the form field.
 

mcclunyboy

Registered User.
Local time
Today, 00:07
Joined
Sep 8, 2009
Messages
292
how would I refersh the query with new data. I tried using other commands but the only way I could get it to work was by actually opening it (I read somewhere it is a limitation as I chose to use a select query rather than a temporary table).
 

James Dudden

Access VBA Developer
Local time
Today, 07:07
Joined
Aug 11, 2008
Messages
369
If it's a select query and the report is based on it then it should refresh as you open the report. If this isn't happening then I must be missing something.
 

mcclunyboy

Registered User.
Local time
Today, 00:07
Joined
Sep 8, 2009
Messages
292
No you're right - I never considered that -of course it does...apologies assuming the form is open of course it will grab the right ID as a parameter.

I will remove the query commands from the sub completely.

EDIT - feel like a right numpty - I am fairly comfortable with access but I use it relatively infrequently - I forget how things work....damn.
 
Last edited:

Users who are viewing this thread

Top Bottom