Rneely
05-08-2003, 02:53 PM
I'm having a problem with the text file. It keeps saying the file is not found. So I tried specifying the path and it says path or file not found. It just started doing this. The text file has been in the same place and has worked many times before.
Irotallic
05-08-2003, 02:55 PM
As long as we don't see the code with what you're trying to acces the file, we can't find out what's wrong with it :) So, just post some code and we will see if we can help.
Rneely
05-08-2003, 02:57 PM
Here's the code for it.This has worked well ever since I wrote it. I haven't changed or moved anything around.
Private Sub main()
Dim lngX As Long
' Change the path to your path.
Open "sneakerprice.txt" For Input As #1
Do
DoEvents ' This enables events to happen during heavy I/O.
ReDim Preserve strAdult(lngX) ' Load Adult field into array
ReDim Preserve strBrand(lngX) ' Load Brand field into array
ReDim Preserve strType(lngX) ' Load Type field into array
ReDim Preserve curPrice(lngX) ' Load Price field into array
Input #1, strAdult(lngX), strBrand(lngX), strType(lngX), curPrice(lngX)
'Debug.Print strAdult(lngX), strBrand(lngX), strType(lngX), strPrice(lngX)
lngX = lngX + 1
Loop Until EOF(1)
Close
frmMain.Show (vbModal)
Irotallic
05-08-2003, 03:01 PM
Ah, I see :) You only give the name of the file. You need to set the path too. Try some code like:
Open "C:\YourDir\sneakerprice.txt" For Input As #1
YuanHao
05-08-2003, 04:37 PM
If you wanna use your app's path, use Open App.Path & "\sneakerprice.txt" For Input As #1