Open a file and add entry

I need help with a program that will have 2 textboxes that when you put your initals in one and your last 3 digits of your SSN in the second one it opens a file named combined and writes a record in the XXX123 = XXX123 format.  Everytime that this program is ran it will open the same file and write a new record to the file.

mtbufordAsked:
Who is Participating?
 
TimCotteeConnect With a Mentor Head of Software ServicesCommented:
Dim intF As Integer
intF = FreeFile()
Open "MyFile.Txt" For Append As #intF
Print #intF,txtInitials.Text & txtSSN.Text
Close #intF

And that is all there is to it!
0
 
bobbit31Commented:
public sub command1_click()
   writeRecord(text1.text & text2.text)
end sub

public sub writeRecord(strID as String)

   Dim ff as Integer
   ff = FreeFile
   
   open strID for output as #ff
   print #ff, "<i don't know exactly what you want to write to the file>"
   close(ff)


end sub
0
 
mtbufordAuthor Commented:
When I use your answer TimCottee I get an object required when it gets to the part of writing the record to the file?
0
 
mtbufordAuthor Commented:
When I use your answer TimCottee I get an object required when it gets to the part of writing the record to the file?
0
 
TimCotteeHead of Software ServicesCommented:
You should replace the txtInitials and txtSSN with the names of the textboxes that this information is recorded in.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.