Closes a specified Database, QueryDef , or recordset .
querydef.Close (Professional Edition Only)
The Close method uses these parts:
database The Database property of a data control. In the Professional Edition, can also be an object variable identifying an open Database.
recordset The Recordset property of a data control. In the Professional Edition, can also be an object variable identifying an open Table, Dynaset, or Snapshot.
querydef In the Professional Edition, an object variable that identifies an open QueryDef.
If you close the recordset or database of a data control, the data control sets all bound controls to Null and nothing will happen when a user clicks the buttons on the data control.
Using Close on the Recordset property of a data control automatically invokes the Update method if an Edit or AddNew operation is pending. Using Close on the Database property of a data control automatically closes all open recordsets. Unloading a form automatically closes a data control's Database property.
If the object is already closed when you use Close, an error occurs.
Caution In the Professional Edition, if you are not using a data control you should use Close on all open recordsets before you close a database. Otherwise you might lose changes from pending Edit or AddNew operations.
In the Professional Edition, any local object variables identifying Databases, Dynasets, QueryDefs, or Tables are automatically closed when the procedure exits. If you are not using a data control, attempting to close a Database that has open recordsets will generate an error.