Getting Started in VB: Saving and Editing MS VB 6.0 frm files

Jennifer Kay, Rowan University Computer Science Department

Background: Forms and Projects

The word FORM is VB's way of referring to a thing that will become a window in your program. A form can have buttons, pictures, text, etc. For example, here's a picture of a form that contains a label, a picture box, a command button, and a text box:

Sample form

Even though this form has lots of things on it, it's still just a single form. However, some programs have lots of windows that open up when you run them (and so use lots of forms). The programs we're going to write this semester will ALWAYS only have one form.

When you write programs with multiple forms, you need to keep track of those forms as a group. You do this by creating a PROJECT. Think of a project as a folder that keeps track of a group of forms that go together.

Since each of our programs will only have one form, it's silly for us to make a project for each program. So we're going to skip that and save some space on our hard drives / flash drives / etc. But VB is going to try desperately to make us create projects. This document explains how to just use forms without projects.

Creating a new program from scratch

Now you've got a single form that you can work with.

Saving your program to your hard drive

VB does NOT automatically save your program. In fact, if VB crashes while you're in the middle of writing a program, all of your work may be lost. You should save often.

VB wants us to save your form and your project. But we know that we don't have to save the project, since we're only using one form in it. So here's how you save just the form:
You will have saved a file of type frm -- a visual basic form

Saving your program to your flash drive

First, follow the steps in "Saving your program to your hard drive" above. Then, use "my computer" to copy the frm file from your hard drive to your flash drive. Do not try to save directly from VB to your flash drive!!

Reopening a program you have already started working on to run it again or work on it some more

  1. If you were working on something else, make sure you save it using the instructions above on "saving your program to your hard drive"
  2. If the item you wish to open is on a flash drive, first copy it to your hard drive (H drive if you're at school) using "my computer"
  3. Go to the file menu and select "open project" (yes, you have to say you want to open a project, don't panic)
  4. If it asks you if you want to save your changes to project 1, just say no (you already saved your form in step one of these instructions, right?
  5. Go to the "files of type" drop down menu, and select "all files (*.*)"
  6. Navigate to where you saved your old file (on your H drive?)
  7. Double click on the frm file that you want to work on.
  8. In the project window (probably near the top on the right hand side of your VB window), click on the plus sign next to the word "Forms"
  9. Double click on the form that appears underneath (probably called "Form 1")