Solved

Open a file and add entry

Posted on 2002-04-24
5
169 Views
Last Modified: 2010-05-02
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.

0
Comment
Question by:mtbuford
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 43

Accepted Solution

by:
TimCottee earned 50 total points
ID: 6965694
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
 
LVL 18

Expert Comment

by:bobbit31
ID: 6965706
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
 

Author Comment

by:mtbuford
ID: 6965757
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
 

Author Comment

by:mtbuford
ID: 6965880
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
 
LVL 43

Expert Comment

by:TimCottee
ID: 6965923
You should replace the txtInitials and txtSSN with the names of the textboxes that this information is recorded in.
0

Featured Post

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question