I have a form which allows me to search through a binary file for a record, but it takes a while, so I want to use a progress bar so the user knows the program is working!
My search code is as follows
filename1 = "F:\Program\CustomersFile.bin"
Dim RecordNumber As Integer
Dim found As Boolean
Dim searchcustid As String
searchcustid = txtSearchCustID.Text
found = False
FileOpen(1, filename1, OpenMode.Random, , , Len(OneCustomer))
Do While (Not EOF(1)) And (found = False)
RecordNumber = RecordNumber + 1
' FileGet(1, filename, RecordNumber)'error in book should be like below!!!!
FileGet(1, OneCustomer, RecordNumber)
If OneCustomer.CustID = searchcustid Then
found = True
End If
Loop
If found Then
Call DisplayOneCustomer(OneCustomer)
'FileClose(1)
Else
MsgBox("Customer ID CANNOT BE FOUND!!", MsgBoxStyle.Critical)
End If
FileClose(1)
I have no experience with progress bars at all. I've looked at a few examples, but struggle to link it with my search code, please could someone advise me on how I would go about this? It would be much appreciated
Thanks very much.

New Topic/Question
Reply




MultiQuote





|