I need a piece of code in a form that returns a value from part of a line in a text file that is 6 units in length – ie CE0305 – this is a reference for a client name. I have it working just now but the structure of referencing is about to change and will could potentially start with a number including 0. When this is the case my code does not work – it will not accept the 0.
The code I have is
If txtClientNum.Value “” And Not IsNull(txtClientNum.Value) Then
Open “s:eliteftpclient.txt” For Input As #2
Do While Not EOF(2) And clnum txtClientNum.Value ‘ Loop until end of file.
Input #2, clrec
clnum = Mid$(clrec, 1, 6)
‘ Loop
‘ If Not EOF(2) Then
Close #2 ‘ Close file.
Else
frmFileRequest2.Hide
MsgBox “Invalid Client Number. Please try again”
Close #2 ‘ Close file.
frmFileRequest2.Show
End
End If
End If
If anyone can shed some light on how I can get it to validate with a zero it would be much appreciated