Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21238

How to check if record already exists in a file?

$
0
0
Here is the code I use to save Names in a .dat file.
How can I check first if the name already exists?

Thank you.

Code:

Private Sub SaveNamesDat()
'----------------------------------------------------------------------

    Dim intFileNbr  As String


mstrName = txtName
    intFileNbr = FreeFile
    Open (App.Path & "\Names.dat") For Append As #intFileNbr
    Print #intFileNbr, mstrName
    Close #intFileNbr

End Sub


Viewing all articles
Browse latest Browse all 21238

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>