working with flat files

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
verify file is closed
FileClose(1)

FilePath = Application.StartupPath.ToString & "" & SelectedYear & "RTSinvoice.fls"



open file
FileOpen(1, FilePath, OpenMode.Random, OpenAccess.ReadWrite, OpenShare.Default, Len(JobQuoteFile))


establish the number of records
Numrecs1 = (LOF(1) / Len(JobQuoteFile))


create the first record if the file is empty
If Numrecs1 <= 0 Then


add new record
FilePut(1, JobQuoteFile, 1)


count record
Numrecs1 = (LOF(1) / Len(JobQuoteFile))


get file
FileGet(1, JobQuoteFile, 1)



notify
MsgBox("New Quote Database Created", MsgBoxStyle.Information, "Create/Edit Quote")


End If
the code above creates a file if none exists and also creates a new record.
after entering data into the record I create a new record but the data from the previous record is automatically entered into the new record upon creation. I can write code to "clean up"the previous data but this takes a lot of code & time.
is there an easier way to create a new record that is blank??

View the full article
 
Back
Top