|
-
Jan 24th, 2008, 05:15 PM
#1
Thread Starter
Frenzied Member
-
Jan 24th, 2008, 05:42 PM
#2
Re: Write To File When Unloading Form
The problem is that iFile is zero. Add this
iFile = FreeFile
-
Jan 24th, 2008, 05:45 PM
#3
Re: Write To File When Unloading Form
BTW, by opening the file for Output you are going to overwrite it so why do SetAttr FileName, vbNormal?
-
Jan 24th, 2008, 05:47 PM
#4
Re: Write To File When Unloading Form
Oh and you don't need Unload Me in the Form_Unload event. You might want to consider however Set <yourforname> = Nothing because otherwise global variables in the form (if any) will maintain their values from the last time it was used.
-
Jan 24th, 2008, 06:55 PM
#5
Thread Starter
Frenzied Member
Re: Write To File When Unloading Form
The problem is that iFile is zero. Add this
iFile = FreeFile
Stupid.....indeed very stupid I am when I have written so many text files in this manner.
BTW, by opening the file for Output you are going to overwrite it so why do SetAttr FileName, vbNormal?
Assuming that a file is hidden, shouldn't it be first be unhidden & then only can that file be written/overwritten?
Oh and you don't need Unload Me in the Form_Unload event. You might want to consider however Set <yourforname> = Nothing because otherwise global variables in the form (if any) will maintain their values from the last time it was used.
Thanks for this useful tip
ARPAN
IF YOU HAVE AN APPLE & I HAVE AN APPLE AND WE EXCHANGE THE APPLES, THEN YOU & I WILL STILL HAVE ONE APPLE BUT IF YOU HAVE AN IDEA & I HAVE AN IDEA AND WE EXCHANGE OUR IDEAS, THEN EACH OF US WILL HAVE TWO IDEAS!
NOTHING IS IMPOSSIBLE IN THIS WORLD.....EVEN THE WORD IMPOSSIBLE SAYS I'M POSSIBLE!
PRACTICE MAKES A MAN PERFECT BUT NOBODY IS PERFECT; SO WHY PRACTICE?
-
Jan 24th, 2008, 07:04 PM
#6
Re: Write To File When Unloading Form
 Originally Posted by arpan_de
....Assuming that a file is hidden, shouldn't it be first be unhidden & then only can that file be written/overwritten?
I'm not %100 sure, but try it.
-
Jan 24th, 2008, 08:59 PM
#7
Thread Starter
Frenzied Member
-
Jan 24th, 2008, 09:02 PM
#8
Re: Write To File When Unloading Form
Okay, you (hopefully) learn something every day.
-
Jan 24th, 2008, 11:12 PM
#9
Thread Starter
Frenzied Member
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|