Modal forms...

branston

Registered User.
Local time
Today, 16:28
Joined
Apr 29, 2009
Messages
372
Hi,

I have a form with a button. When the button is pressed a lot of tables are opened, closed, edited etc. I have created another form which basically says "Please Wait", with a nice little timer saying how much time had elapsed. What I wanted was that to fill the whole screen while all the other things happened out of sight.

Obviously teh docmd.echo wouldnt work, as the timer would also freeze, so i thought that making the timer form modal would work... but it doesnt, i can still see all the tables and things flashing up.

Is there a way in vba (or otherwise) to get a form to stay in the forground, no matter whats going on behind??

Thank you!
 
Check out the "echo" option in the help, see if that is what you are looking for...
 
No, im afraid not, like I said im my post, I need the screen to be re-painted so that the timer on the pop up form works.

Thanks for the reply though.
 
Well within the echo, you could explicitly repaint your form... Dont know if that does the trick... but something worth looking into?
 
Instead of trying to cover them, open the background stuff hidden.

DoCmd.OpenForm FormName, blah, blah, ... ,acHidden

Similarly other objects: DoCmd.OpenTable etc
 
Last edited:
GlaxiomAtHome, namliam, thank you both for the suggestions. Both make sense and ill be trying them out!

Thank you!
 
GlaxiomAtHome, namliam, thank you both for the suggestions. Both make sense and ill be trying them out!

Thank you!

Forms also have an annoying option called popup that you can use to force it to the top of the screen. You can then use it sort of like a custom message box.
 
Ah, so maybe i should try pop-up rather than modal (I thought modal did that!) Thanks joh24

I looked into the other sugestions but... Ive been having problems with using echo on this bit of code, for some reason it seems to just ignore it. Also, i looked into hiding the form, but there seemed to be quite a lot saying if you compact and repair your database with hidden tables they get deleted!!! Not sure if i want to risk that!

Just tried it out, and the 'annoying option' works like a dream.

Thank you!
 
Hidden forms and tables beeing deleted??? I have never heard about that one...
 
Ah, so maybe i should try pop-up rather than modal (I thought modal did that!)

Modal means that it holds the focus and you cannot get to any other objects until it is closed.

Also, i looked into hiding the form, but there seemed to be quite a lot saying if you compact and repair your database with hidden tables they get deleted!!!

You would be confusing this with what happens when you delete Access objects. The objects are just hidden until the database is compacted. This is not the same as opening them in hidden mode which doesn't do anything bad. It actually saves memory compared to having them displayed.

However it is important to close them afterwards or they will remain in memory until you exit the program. Forget a few times and you will really choke your computer.
 
Thanks for all your explainations. This i will leave it as a pop up though, as it works just as i wanted.

Always good to learn things though!

Thank you all for you help!
 
Having said that... would the pop up affect the screen being re-painted?
The last section of code says basically open a form and go to a specific record, once all the code is run i then tell the pop-up form to close... but all im left with is a blank screen!
Is there a reason why the form i told to open isnt being shown? Its name is in the access tool bar, but i just see a grey screen. Ive tried putting a repaint at the end of the code but that doesnt do anything.
Would this be what makes the pop-ups annoying?!
 
Ignore me... i had a rouge docmd.echo false. Taken that out and its all fixed!
 

Users who are viewing this thread

Back
Top Bottom