VFP Form Management

Question:
How do I call a form from another form using a command button?

Answer:
You can put code into the Click event of the command button that executes a DO FORM command that will bring up the form you want. For example:

  1. Create a form called ParentForm by executing the following command in the Command Window:
    MODIFY FORM ParentForm

  2. Add a command button to this form and put the following code into the Click event of the command button:
    DO FORM ChildForm

  3. Set the caption of the form to “Parent.”
  4. Save the form.
  5. Create a form called ChildForm by executing the following command in the Command Window:
    MODIFY FORM ChildForm

  6. Set the caption of the form to “Child.”
  7. Save the form.
  8. Execute the following command from the Command Window:
    DO FORM ParentForm

  9. Click on the command button. You should see the Child form come up.
Share the Post:
Share on facebook
Share on twitter
Share on linkedin

Overview

Recent Articles: