For example, suppose you have a procedure that must be run the first time each user logs onto your database. You can set the OnClick property of a button on the form to this procedure. Once the user has logged on and run the procedure, you can use the DeleteControl method to dynamically remove the command button from the form.
Syntax
DeleteControl formname, controlname
DeleteReportControl reportname, controlname
The DeleteControl and DeleteReportControl methods have the following arguments.
Argument | Description |
---|---|
formname, reportname | A string expression identifying the name of the form or report containing the control you want to delete. |
controlname | A string expression identifying the name of the control you want to delete. |
Remarks
The DeleteControl and DeleteReportControl methods are available only in form Design view or report Design view, respectively.
Note If you are building a wizard that deletes a control from a form or report, your wizard must open the form or report in Design view before it can delete the control.