ReplaceLine

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jige
    New Member
    • Sep 2006
    • 2

    ReplaceLine

    Code:
     
    Sub TestCommand_Click()
    Application.Echo False
    DoCmd.OpenModule "TestModule"
    Modules!TestModule.ReplaceLine 2, "TestString = " & now()
    DoCmd.Close acModule, "TestModule", acSaveYes
    Application.Echo True
    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!
  • PEB
    Recognized Expert Top Contributor
    • Aug 2006
    • 1418

    #2
    Hi TIA

    Maybe
    application.qui t
    or
    application.exi t

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

    do sendkeys procedure with combination Alt F4

    :)

    Comment

    • MJS
      New Member
      • Jul 2007
      • 1

      #3
      Since the code is ran from a command button on a form the following may be useful.

      Sub TestCommand_Cli ck()
      Application.Ech o False
      DoCmd.OpenModul e "TestModule "
      Modules!TestMod ule.ReplaceLine 2, "TestString = " & now()
      DoCmd.Close acModule, "TestModule ", acSaveYes

      ' Set the focus to the form
      Me.SetFocus

      Application.Ech o True
      End Sub

      Comment

      Working...