473,320 Members | 2,092 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

ReplaceLine

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
2 2381
PEB
1,418 Expert 1GB
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
MJS
1
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

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

Similar topics

4
by: Amit Kulkarni | last post by:
Hi, I have small problem. I want to truncate a line in a text file using C file handling functions and write new line in place of it. How do I do it? e.g. "example.txt" Line 1: This is a...
7
by: Hank | last post by:
My boss wants to be able to set the background color of all forms to one color that he selects on our Configuration form.. I'd rather not add a function to every form I have and wondered if it...
2
by: AA Arens | last post by:
During my database construction, I left the names of the buttons, comboboxes named by default like Combo77, Command43. I can rename them with Properties Other Name, but them I start getting...
3
by: peterhall | last post by:
In VBA an Access module has a find method - works perfectly to find a string inside a module. i'm working in A97 (legacy) systems (large ones) and want to write code that searches all modules so that...
6
by: SmithHerf | last post by:
We have sent out 300 CDs with our yearly DB on it. Problem is there are 2 places within 2 different forms that we have a button that uses VBA to load an Excel spreadsheet depending on data and...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.