If you can't explain it simply,
you don't understand it well enough.
-Albert Einstein
 
Home   News   Tips   Glossary   Templates   Forums   Help   Logon   Order   Contact Us  
 
NEW Release: Access Developer Level 3   dismiss
 
 
Courses - Microsoft Visual Basic 201
Description: Intermediate Microsoft Visual Basic
Running Time: 83 minutes
Pre-Requisites: Visual Basic 107 strongly recommended
Versions: We use Microsoft Visual Basic 6.0, but lessons are valid for most earlier versions of VB, including 4 and 5. If you have VB.NET or VB 2005, the Visual Basic code we use is similar, but the programming interface has changed. These VB courses do NOT cover VBA (Visual Basic for Applications) which is what you need for Microsoft Office programming. For VBA, see the individual Office applications (Word, Excel, Access, etc.) Click here for more information on VB.NET courses.


Order Now: $19.99

 

 

 Click here for the Teacher's Outline
 
Notice: this course covers the older Visual Basic 6.0 programming application. Microsoft no longer sells VB6. If you want to learn VB6, you'll have to find a used copy somewhere like eBay or Craigslist. We will be updating this course for use with Visual Basic 2013 soon. If you've purchased this course within the last year, you'll get a free upgrade when it's released.

This course follows VB107. We'll cover one of the most important topics yet: reading and writing text files. We'll start out learning how to write a text file. We'll learn about the Open, For Output As, Print #1, Close #1, and FreeFile commands.



We'll keep the first example easy - enter a customer's name
and a filename, and save the data to the file.
 

Now that we know how to save data to a file, we'll learn how to read it back in. We'll learn about the Open For Input command, Line Input, creating our own subroutine, and the Shell command.



Our program has gotten more sophisticated. We can save the
data to a file, load it back in, and View it with the Notepad application
using the Shell command to launch a program. The program also
saves the size of the form too - so the next time it loads to the same size
 

Next we'll learn how to save multiple items. We'll load up a bunch of customers into a ListBox and then save all of those items to a file.



Now we can type in a customer, add him to the listbox, and then
save the entire contents of the listbox at once.
 

In this lesson we'll also learn about the TabIndex property which is how you control your Tab Order - the order in which you move between fields when you press the TAB key on your keyboard.

Next, we need to learn how to read this list of customers back in when the program starts, so we'll learn how to fill the listbox back up from our saved records.

This means we will need to learn how to break up a delimited string into its individual parts. We'll learn about the InStr function and EOF marker. We'll learn the With keyword, and how to send a parameter to a sub.



Breaking down comma-delimited strings is easy once you know InStr
 

I know the screenshots from this class don't look exciting, but we cover a lot of great material in this class. Learning how to read and write information to disk is extremely important, and is a fundamental method of making your programs work.


 

 Click here for the Teacher's Outline
 


Try a FREE Demo Lesson

 
 
 

Student Interaction: Visual Basic 201

Richard on 1/1/2008:  VB201 covers reading and writing text files, tab order, and delimited strings.
Karl Peters on 5/6/2009: I have REALLY enjoyed all the video tutorials that i have watched and studied so far. I have learned more about programming in such a short time from your video's than i have learned from any other source. I am presently on VB 201 video, and so far this one is my favorite. I found it quite riveting (was almost late for work the other day, lost track of time LOL) Can't wait to start on the VB 202, and hopefully future VB6 courses will be released. GREAT VIDEO TUTORIALS!!
Lilly Nguyen on 9/21/2010: Thank you for your on-line courses. They help me alots.
I am having a problem with Shell function.
I try to view a file from click button with a code like this
Shell "NotePad.exe" & Filename, vbNormalFocus

I have an error message " File not file". I went to window explorer and the the does exist. What did I do wrong? Please help me!
Thanks

Anonymous on 10/13/2011: it is good to have such a comprehensive resource
Genet Pinna on 5/4/2014: Hi Richard,
Is it possible to connect VB with Access database and vice versa? If it is possible, how can it be done? I learned a lot from your courses.
Thanks

Reply from Richard Rost:

Yes, it's possible using a recordset.

 

You may want to read these articles from the 599CD News:

 

Learn
 
Accessindex
Excelindex
Wordindex
Windowsindex
PowerPointindex
Photoshopindex
Visual Basicindex
ASPindex
Seminars
More...
Customers
 
Account Login
Online Theater
Downloads
Lost Password
Free Upgrades
Insider Circle
Student Databases
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Articles
Search Our Site
Waiting List
Production Schedule
Collapse Menus
Help
 
Live Chat
Customer Support
WalkThru Tutorials
Troubleshooting
FAQs
TechHelp
Consulting Services
About Us
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
Order
 
Video Tutorials
Handbooks
MYOLP Memberships
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Gift CDs
Contact
 
Live Chat
General Info
Support Policy
Contact Form
Email Us
Mailing Address
Phone Number
Fax Number
Course Survey
Facebook    Twitter

Google Plus    LinkedIn

Blog RSS Feed    YouTube Channel
Richard Rost Microsoft MVP