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

ReplaceLine

P: 2
Expand|Select|Wrap|Line Numbers
  1.  
  2. Sub TestCommand_Click()
  3. Application.Echo False
  4. DoCmd.OpenModule "TestModule"
  5. Modules!TestModule.ReplaceLine 2, "TestString = " & now()
  6. DoCmd.Close acModule, "TestModule", acSaveYes
  7. Application.Echo True
  8. End Sub
No problem whatsoever with the line replacement. However, after running the code, Access 2003 leaves behind on the top of my desktop a moduleless "Microsoft Visual Basic" empty window which I have to close manually. How can I not have the annoyance?

TIA!
Oct 10 '06 #1
Share this Question
Share on Google+
2 Replies


PEB
Expert 100+
P: 1,418
PEB
Hi TIA

Maybe
application.quit
or
application.exit

or sthg that close the visual basic editor... If its active

do sendkeys procedure with combination Alt F4

:)
Oct 14 '06 #2

P: 1
MJS
Since the code is ran from a command button on a form the following may be useful.

Sub TestCommand_Click()
Application.Echo False
DoCmd.OpenModule "TestModule"
Modules!TestModule.ReplaceLine 2, "TestString = " & now()
DoCmd.Close acModule, "TestModule", acSaveYes

' Set the focus to the form
Me.SetFocus

Application.Echo True
End Sub
Jul 12 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.