|
-
Dec 27th, 1999, 09:04 AM
#1
Thread Starter
Hyperactive Member
Help,Thank You, and Happy Holidays!
What's wrong with this code? I get a "path not found" error used within form and "invalid outside procedure" error when used in module. I can't remember how to do this. I'm using this part of a code found here that was edited by "Kieko":
Type Record
FirstDate As Date
MaxDate As Date
Count As Integer
End Type
Dim rec As Record
Dim strFile As String
Dim blnSuccess As Boolean
blnSuccess = False
strFile = "c:\windows\desktop\rnd\a.txt"
If (Dir(strFile) = "") Then
'not found then create a new one
Open strFile For Random As #1 Len = Len(rec)
rec.Count = 0
rec.FirstDate = Date
rec.MaxDate = Date
Put #1, , rec
blnSuccess = True
Close #1
Can anyone help me?
Have a great new year even if you can't,thank you!
JoeyO
-
Dec 27th, 1999, 10:55 AM
#2
Guru
You get "Path Not Found" because you do not have a folder called 'RND' on your desktop. Add some code to check for the existence of this folder, and create it if it does not.
HTH
Tom
-
Dec 28th, 1999, 07:15 AM
#3
Thread Starter
Hyperactive Member
Clunietp:
Thats the point. I need to know how to create it. Is there a command like:
Create.NewFile = "C:\MyNewFile"? I feel like an idiot because I know I did it before but I've got no refrence books with me. Can anyone help me out?
-
Dec 28th, 1999, 01:13 PM
#4
Guru
here ya go Joey:
Code:
If Dir("C:\TEST", vbDirectory) = "" Then
MkDir ("C:\TEST")
Else
MsgBox "Test already exists!"
End If
'save file here, the directory exists
Tom
-
Dec 28th, 1999, 10:34 PM
#5
Thread Starter
Hyperactive Member
Thanks Again You guys are awsome!
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
|