By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,462 Members | 2,394 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,462 IT Pros & Developers. It's quick & easy.

Can't hide code in app variable...

P: n/a
Hello

I have a variable dim'd as an Access.Application. I have a routine that
adds a few lines of code in a module to another database. But when I open
the module from the app variable, that code window is visible! I've used
the app.visible = false, but that doesn't work. The app.docmd.openmodule
doesn't have a hidden parameter like forms and reports. How do I keep the
code window from popping up?

Here's what I've got:

dim app as Access.Applicaiton
dim sClassName as string

sclassname = "MyClass"

Set app = new Access.Application
App.Visible = False
App.OpenCurrentDatabase <dbname>
App.Visible = False

App.DoCmd.OpenModule sClassName
With App.Modules(sClassName)
.DeleteLines 1, .CountOfLines
.AddFromFile <filename>
End With
App.DoCmd.Save acModule, sClassName
App.DoCmd.Close acModule, sClassName, acSaveNo

I've tried using a module variable, using the acSaveYes option, adding
"app.visible = false" before every line, nothing seems to work.

Any ideas?

Thanks.

Matthew Wells
MW****@FirstByte.net

Nov 25 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Matthew Wells wrote:
How do I keep the
code window from popping up?
The best way is to save the inserted code in a module in a template database
beforehand, then use TransferDatabase to export the module from the template
database to the target database and the user won't see it happening in the
background. Another way is to set Echo off when the other database opens so
the screen doesn't update during the insertion, but the user will still see
*something,* just not the text you're inserting.

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/200611/1

Nov 25 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.