Condividi tramite


Passing Parameters to a Form

Sometimes you want to pass parameters to forms when you run them to set property values or specify operational defaults.

To pass a parameter to a form created in the Form Designer

  1. Create properties on the form to hold the parameters, such as ItemName and ItemQuantity.

  2. In the Init event code for the form, include a PARAMETERS statement such as:

    PARAMETERS cString, nNumber
    
  3. In the Init event code for the form, assign the parameters to the properties, as in this example:

    THIS.ItemName = cString
    THIS.ItemQuantity = nNumber
    
  4. When running the form, include a WITH clause in the DO FORM command:

    DO FORM myform WITH "Bagel", 24
    

See Also

Hiding a Form | Saving a Form as HTML | Creating Forms | Managing Multiple Instances of a Form | Setting the Design Area for a Form | Returning a Value from a Form