Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hiding screens in Access while running code

Status
Not open for further replies.

obub

Technical User
Mar 11, 2002
11
US
I am running a code that involves opening two forms, getting the information, and then closing the forms. The information cannot be pulled from the forms if they are minimized or hidden (don't know why). There is a command in Excel (Screen Update) to prevent the screen display while running the code, but I could not find such a command in Access (97). I do not want the two forms to be seen while running the code. Can anybody help me?
 
What version of access are you using? Can you show me some of the code you're using?

I use hidden forms for a few different purposes and I've never had an issue retrieving data from them... Kyle [pipe]
 
Kyle,

I am using Access 97. I was not very specific earlier....I have used the hidden command in previous instances, and it allowed me to retrieve data. In this case, I have to open 2 forms, find the specific record in both forms, and compare the fields to a specific variable. If If I hide the 2 forms or minimize them, it will not find the specific record. (I am using the FindRecord command, and I am thinking that is why it does not work if I hide the forms).

I appreciate your help.

 
FindRecord has nothing to do with forms, per se. Your problem is somewhere else.

However, to answer your question, there is an APPLICATION.ECHO method that might be along the lines of what you want. Here's what the Help system says about it:
----------------------------------------
The Echo method specifies whether Microsoft Access repaints the display screen.

Syntax

Application.Echo echoon[, statusbartext]

The Echo method has the following arguments.

Argument Description
echoon True (default) indicates that the screen is repainted; False indicates that the screen isn't repainted.

statusbartext A string expression that specifies the text to display in the status bar when repainting is turned on or off.

Remarks

If you are running Visual Basic code that makes a number of changes to objects displayed on the screen, your code may be faster if you turn off screen repainting until the procedure has finished running. You may also want to turn repainting off if your code makes changes that the user shouldn't see or doesn't need to see.
The Echo method doesn't suppress the display of modal dialog boxes, such as error messages, or pop-up forms, such as property sheets.

If you turn screen repainting off, the screen won't show any changes, even if the user presses CTRL+BREAK or Visual Basic encounters a breakpoint, until you turn screen repainting back on. You may want to create a macro that turns repainting on and assign the macro to a key or custom menu command. You can then use the key combination or menu command to turn repainting on if it has been turned off in Visual Basic.
If you turn screen repainting off and then try to step through your code, you won't be able to see your progress through the code, or any other visual cues, until repainting is turned back on. However, your code will continue to execute.

Note Don't confuse the Echo method with the Repaint method. The Echo method turns screen repainting on or off. The Repaint method forces an immediate screen repainting.
-------------------------------------------- Ex-JimAtTheFAA
78.5% of all statistics are made up on the spot.
Another free Access forum:
More Neat Access stuff at
 
Thanks WildHare, I'll give that a shot.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top