storing text from the immediate window

jadeIT

Systems Analyst
Local time
Tomorrow, 02:56
Joined
Jul 16, 2002
Messages
50
Hi..

Was wondering if it is possible to make it so you can save or copy the text from the immediate window into a text file or somewhere else in code???
 
You can use the Copy and Paste Method (Highlight what you want and copy it to the file)


Or

Don't send it to the immediate window, instead look into the "Open" method. This will allow you to use the "Print" method and send items that you use Debug.Print on to a Text file instead.
 
openTextFile

I am using a method called 'OpenTextFile' and it lets me append to a text file. Now I can log what is happening on the database...

However one thing; as you'd expect you must specify the name and path of the textfile to append to eg "c:\textfile.txt".

I was wondering if there is a way to find out the path of the database? Like when using the 'app.path' variable in Visual Basic 6...
 
Last edited:
Yeah thats what I thought... however 'path' doesnt appear in the look up list for the application object...

I tried using it anyway

opentextfile(application.path + "\log.txt",8,0)

for example, however I get a "Method of Data member not found" error.
 
Code:
Function getapp()
'*******************************************
'Name:      getapp (Function)
'Purpose:   Get the path and name of the
'           current application
'Calls:     from debug windows: ? getapp
'Output:    sample: C:\My Documents\logpages.mdb
'*******************************************

Dim db As DATABASE
Set db = CurrentDb
getapp = db.Name
End Function
 
James-

Glad it helped. It was tested before publication.

Travis-

Quit distributing 'I think it might be...' solutions and test them before you publish them.

Bob
 
In Versions of Access Prior to A2K the path was:

Application.Path which corresponded to Visual Basic's App.Path.

In A2K the CurrentProject was added and the Path came under this.

My mistake was in giving only the A97 command and not the A2K command as well. For that I appoligize.

Bob, I do not feel however that I was deserving of your comment that you placed here in this post.
 
Travis-

You very well could be correct.

My apologies for any offense caused.

Bob

p.s. Test 'em first -- it's a protocol with no serious adverse side-effects.
 

Users who are viewing this thread

Back
Top Bottom