|
-
Dec 2nd, 1999, 02:02 PM
#1
Thread Starter
Lively Member
I Still cannot get this to work can anyone please tell me where the problem is and what i am doing wrong . a file number is entered
in a text box automaticaly the file exits but i am gettig a error 75 Please help am new to VB
Private Sub Open_File()
Dim intFreeFile As Integer
Dim strFileName as String
strFileName = txtFileName.Text
strFileName = Dir("d:\Home.txt")
intFreeFile = FreeFile
Open strFileName For Input As #intFreeFile
Do
Line Input #intFreeFile, strMember
Line Input #intFreeFile, strname
Line Input #intFreeFile, strlastname
Line Input #intFreeFile, straddress
Line Input #intFreeFile, strphone
Loop Until EOF(intFreeFile)
Close #intFreeFile
End Sub
i Know that i could set up a control array and it would be easier but i want to get this way to work first The runtime error is 75
i Know it is something really stupid that i have overlooked or forgot to do
-
Dec 2nd, 1999, 02:21 PM
#2
Member
Private Sub Open_File()
Dim intFreeFile As Integer
Dim strFileName As String
'''''''strFileName = txtFileName.Text
strFileName = Dir("d:\Home.txt")
intFreeFile = FreeFile
Open strFileName For Input As #intFreeFile
Do
'''''''Line Input #intFreeFile, strMember
'''''''Line Input #intFreeFile, strname
'''''''Line Input #intFreeFile, strlastname
'''''''Line Input #intFreeFile, straddress
'''''''Line Input #intFreeFile, strphone
Input #intFreeFile, strMember, strname, strlastname, straddress, strphone
Loop Until EOF(intFreeFile)
Close #intFreeFile
If you use line input#, it is to read entire records into a single variable. it also read an entire commas, quotation marks, exclamation marks, hyphens, everything else!
If you use #input, it is to read data into a list of variables...
ROSE
-
Dec 2nd, 1999, 02:33 PM
#3
Thread Starter
Lively Member
thxs rose But why am i getting a filepath error when i run the program eg 75
-
Dec 2nd, 1999, 02:42 PM
#4
Member
75?
I have no idea...
Perhaps, it could not find the directory path.
Let me see your code...? I can help you in any ways.
-
Dec 2nd, 1999, 04:04 PM
#5
Addicted Member
Hi Jessie,
The file isn't there
D:\Home.Txt
Try to create Home.Txt (empty also never mind), there should not be any error 75 again.
Does it help ?
Regards
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
|