How to add records to a text file!
Below are the steps to get you started!
Note: These images are for educational purposes only, no monitary gain involved.
1. Adding the start form and record button:
Like any other project, open the file as usual. This time however, add a button labeled "Add Records" (Create a new form aswell and have this button link to it!)
2. Creating the required input form:
This time you can get creative! Add a form and decorate it to your liking, include at least 1 field you wish to be added to the text file (I.E. name or Birth Place). Take this example and incorportae yor own ideas, or copy it exactly if you wish!
3. Creating the code for the 2nd form:
This may look complicated, but never fear! This code actually creates the text file for you! Copy down what I have pictured (Note: Variable names may be different, be sure to define your own for your own use in this project! I.E. div EXAMPLE as single). Once your button is clicked, the data you entered into the text boxes will save into a brand new text file! (Be sure you used textboxes first, they are the easiest to learn from!) Since we are teaching you only the basics, the "strLine" format is optional, as it only adds order and design to your text file!
4. Checking to see if it worked!:
Note: Dont forget to run your program and add your records in!
Check where you set the file to save to, if you see your file name (mine was students), then you know you got the file saving part right! now lets open it to see if the records saved!
5. Checking to see if it worked (Part 2)!:
Open the file (could be named anything due to your choice). If the records you added in, if the records are shown, then you've completed your goal and successfully added records to a text file via VB! (Down below are the results from mine!)
Congrats! You completed your goal!
Time to kick back and relax, you've earned your bragging rights...well...somewhat...
Abraham Krolikowski 2018