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
-
Create properties on the form to hold the parameters, such as ItemName and ItemQuantity.
-
In the Init Event code for the form, include a PARAMETERS statement such as:
В Copy Code PARAMETERS cString, nNumber
-
In the Init event code for the form, assign the parameters to the properties, as in this example:
В Copy Code THIS.ItemName = cString THIS.ItemQuantity = nNumber
-
When running the form, include a WITH clause in the DO FORM Command:
В Copy Code DO FORM myform WITH "Bagel", 24