From fe428d85d8879ad63285a2ca799b8e78a51f68fd Mon Sep 17 00:00:00 2001 From: Linda Caputo Date: Wed, 26 Sep 2018 09:25:54 -0700 Subject: [PATCH] Edit pass on Concepts sections Printing, Reports, Settings, Windows API, XML --- .openpublishing.redirection.json | 8 + ...ally-if-it-does-not-contain-any-records.md | 8 +- .../filter-a-report-using-a-form-s-filter.md | 8 +- ...matically-retrieve-printer-capabilities.md | 18 +- .../retrieve-a-list-of-installed-printers.md | 9 +- ...k-with-form-and-report-printer-settings.md | 44 ++-- ...eate-alternating-row-colors-on-a-report.md | 8 +- ...m-report-and-control-properties-in-code.md | 22 +- .../Settings/activex-data-objects-ado.md | 17 -- .../Settings/data-access-objects-dao.md | 38 --- ...-in-another-microsoft-access-database-o.md | 2 +- ...-and-control-properties-in-visual-basic.md | 8 +- .../Settings/set-options-from-visual-basic.md | 238 +++++++++--------- .../set-properties-by-using-visual-basic.md | 16 +- .../set-references-to-type-libraries.md | 24 +- ...-startup-properties-and-options-in-code.md | 14 +- .../determine-when-a-shelled-process-ends.md | 216 ++++++++-------- ...retrieve-information-from-the-clipboard.md | 19 +- ...me-of-the-user-logged-on-to-the-network.md | 8 +- .../send-information-to-the-clipboard.md | 12 +- access/Concepts/XML/export-a-report-to-xml.md | 14 +- ...t-data-schema-and-related-tables-to-xml.md | 15 +- api/TOC.md | 2 - 23 files changed, 360 insertions(+), 408 deletions(-) delete mode 100644 access/Concepts/Settings/activex-data-objects-ado.md delete mode 100644 access/Concepts/Settings/data-access-objects-dao.md diff --git a/.openpublishing.redirection.json b/.openpublishing.redirection.json index 06601e54ac4..4e34888e1dc 100644 --- a/.openpublishing.redirection.json +++ b/.openpublishing.redirection.json @@ -135,6 +135,14 @@ { "source_path": "access/Concepts/Maintenance/recover-tables-deleted-from-a-database.md", "redirect_url": "/office/vba/access/concepts/miscellaneous/recover-tables-deleted-from-a-database" + }, + { + "source_path": "access/Concepts/Settings/data-access-objects-dao.md", + "redirect_url": "/office/vba/api/overview/access" + }, + { + "source_path": "access/Concepts/Settings/activex-data-objects-ado.md", + "redirect_url": "/office/vba/api/overview/access" } ] diff --git a/access/Concepts/Printing/close-a-report-automatically-if-it-does-not-contain-any-records.md b/access/Concepts/Printing/close-a-report-automatically-if-it-does-not-contain-any-records.md index 2371598d24f..f77de36daff 100644 --- a/access/Concepts/Printing/close-a-report-automatically-if-it-does-not-contain-any-records.md +++ b/access/Concepts/Printing/close-a-report-automatically-if-it-does-not-contain-any-records.md @@ -1,14 +1,14 @@ --- -title: Close a Report Automatically If It Does Not Contain Any Records +title: Close a report automatically if it does not contain any records ms.prod: access ms.assetid: 9b160bd3-6eca-f907-ae5b-4327c3c1618e -ms.date: 06/08/2017 +ms.date: 09/26/2018 --- -# Close a Report Automatically If It Does Not Contain Any Records +# Close a report automatically if it does not contain any records -The following example shows how to use the **[NoData](../../../api/Access.Report.NoData.md)** event to cancel opening or printing a report when it has no data. A message box notifying the user that the report has no data is also displayed. +The following example shows how to use the **[NoData](../../../api/Access.Report.NoData.md)** event to cancel opening or printing a report when it has no data. A message box notifying the user that the report has no data is also displayed. ```vb diff --git a/access/Concepts/Printing/filter-a-report-using-a-form-s-filter.md b/access/Concepts/Printing/filter-a-report-using-a-form-s-filter.md index eb2b971c04d..fbc0dcd4fea 100644 --- a/access/Concepts/Printing/filter-a-report-using-a-form-s-filter.md +++ b/access/Concepts/Printing/filter-a-report-using-a-form-s-filter.md @@ -1,14 +1,14 @@ --- -title: Filter a Report Using a Form's Filter +title: Filter a report using a form's filter ms.prod: access ms.assetid: 2b029c13-5abd-4865-cd05-25d094a97b9f -ms.date: 06/08/2017 +ms.date: 09/26/2018 --- -# Filter a Report Using a Form's Filter +# Filter a report using a form's filter -The following example illustrates how to open a report based on the filtered contents of a form. To do this, specify the form's **[Filter](../../../api/Access.Form.Filter(property).md)** property as the value of the **[OpenReport](../../../api/Access.DoCmd.OpenReport.md)** method's _WhereCondition_ argument. +The following example illustrates how to open a report based on the filtered contents of a form. To do this, specify the form's **[Filter](../../../api/Access.Form.Filter(property).md)** property as the value of the **[OpenReport](../../../api/Access.DoCmd.OpenReport.md)** method's _WhereCondition_ argument. ```vb diff --git a/access/Concepts/Printing/programmatically-retrieve-printer-capabilities.md b/access/Concepts/Printing/programmatically-retrieve-printer-capabilities.md index 30a3adfb073..136322b4350 100644 --- a/access/Concepts/Printing/programmatically-retrieve-printer-capabilities.md +++ b/access/Concepts/Printing/programmatically-retrieve-printer-capabilities.md @@ -1,19 +1,17 @@ --- -title: Programmatically Retrieve Printer Capabilities +title: Programmatically retrieve printer capabilities ms.prod: access ms.assetid: 8c929823-6b61-16ea-6d84-ff47cc1e8389 -ms.date: 06/08/2017 +ms.date: 09/26/2018 --- -# Programmatically Retrieve Printer Capabilities +# Programmatically retrieve printer capabilities -The **[Printers](../../../api/Access.Printers.md)** collection and **[Printer](../../../api/Access.Printer.md)** object allow you only to set or retrieve settings for a printer. To determine a printer's capabilities, such as the kinds of paper or paper bins it supports, you must use calls to the Windows Application Programming Interface (API) **DeviceCapabilities** function. It is beyond the scope of this topic to cover this in detail, but the following code sample from the modPrinters module of the PrinterDemo.mdb sample download demonstrates how to retrieve the names and IDs of the supported paper size and paper bins for a printer. +The **[Printers](../../../api/Access.Printers.md)** collection and **[Printer](../../../api/Access.Printer.md)** object allow you only to set or retrieve settings for a printer. To determine a printer's capabilities, such as the kinds of paper or paper bins it supports, you must use calls to the Windows Application Programming Interface (API) **DeviceCapabilities** function. It is beyond the scope of this topic to cover this in detail, but the following code sample from the modPrinters module of the PrinterDemo.mdb sample download demonstrates how to retrieve the names and IDs of the supported paper size and paper bins for a printer. The following code should be pasted into the general declarations section of a module. - - ```vb ' Declaration for the DeviceCapabilities function API call. Private Declare Function DeviceCapabilities Lib "winspool.drv" _ @@ -30,9 +28,9 @@ Private Const DEFAULT_VALUES = 0 ``` -The following procedure uses the **DeviceCapabilities** API function to display a message box with the name of the default printer and a list of the paper sizes it supports. - +
+The following procedure uses the **DeviceCapabilities** API function to display a message box with the name of the default printer and a list of the paper sizes it supports. ```vb Sub GetPaperList() @@ -110,9 +108,9 @@ GetPaperList_Err: End Sub ``` -The following procedure uses the **DeviceCapabilities** API function to display a message box with the name of the default printer and a list of the paper bins it supports. - +
+The following procedure uses the **DeviceCapabilities** API function to display a message box with the name of the default printer and a list of the paper bins it supports. ```vb Sub GetBinList(strName As String) diff --git a/access/Concepts/Printing/retrieve-a-list-of-installed-printers.md b/access/Concepts/Printing/retrieve-a-list-of-installed-printers.md index cdc231e780b..d27262438cb 100644 --- a/access/Concepts/Printing/retrieve-a-list-of-installed-printers.md +++ b/access/Concepts/Printing/retrieve-a-list-of-installed-printers.md @@ -1,15 +1,16 @@ --- -title: Retrieve a List of Installed Printers +title: Retrieve a list of installed printers ms.prod: access ms.assetid: e3162c3e-6b5b-77c3-32f9-1fdfa64cdefc -ms.date: 06/08/2017 +ms.date: 09/26/2018 --- -# Retrieve a List of Installed Printers +# Retrieve a list of installed printers -You use the **[Printers](../../../api/Access.Application.Printers.md)** property of the **[Application](../../../api/Access.Application.md)** object to return the **[Printers](../../../api/Access.Printers.md)** collection. The following procedure illustrates how to enumerate through each **Printer** object in the **Printers** collection by using a **For Each…Next** statement. A message box is displayed with information about each installed printer. +You use the **[Printers](../../../api/Access.Application.Printers.md)** property of the **[Application](../../../api/Access.Application.md)** object to return the **[Printers](../../../api/Access.Printers.md)** collection. +The following procedure illustrates how to enumerate through each **Printer** object in the **Printers** collection by using a **For Each…Next** statement. A message box is displayed with information about each installed printer. ```vb Sub ShowPrinters() diff --git a/access/Concepts/Printing/work-with-form-and-report-printer-settings.md b/access/Concepts/Printing/work-with-form-and-report-printer-settings.md index 24cfc206fc8..dde9cd79477 100644 --- a/access/Concepts/Printing/work-with-form-and-report-printer-settings.md +++ b/access/Concepts/Printing/work-with-form-and-report-printer-settings.md @@ -1,50 +1,49 @@ --- -title: Work with Form and Report Printer Settings +title: Work with form and report printer settings ms.prod: access ms.assetid: 14a8aa00-9ad8-60f7-e103-791ab08c0e9e -ms.date: 06/08/2017 +ms.date: 09/26/2018 --- -# Work with Form and Report Printer Settings +# Work with form and report printer settings -The **[Printer](../../../api/Access.Printer.md)** objects associated with **[Form](../../../api/Access.Form.md)** and **[Report](../../../api/Access.Report.md)** objects support the same properties and programming techniques as the **[Application](../../../api/Access.Application.md)** object's **Printer** object. Use the **Printer** object of a **Form** or **Report** object when you want to set or retrieve printer settings for a specific form or report. You can change form and report printer settings temporarily, or you can save those settings with the form or report. +The **[Printer](../../../api/Access.Printer.md)** objects associated with **[Form](../../../api/Access.Form.md)** and **[Report](../../../api/Access.Report.md)** objects support the same properties and programming techniques as the **[Application](../../../api/Access.Application.md)** object's **Printer** object. +Use the **Printer** object of a **Form** or **Report** object when you want to set or retrieve printer settings for a specific form or report. You can change form and report printer settings temporarily, or you can save those settings with the form or report. -## Saving Printer Settings with a Form or Report -Whether a form or report uses the settings of the default application printer (the settings managed with the **Application** object's **Printer** object) is determined by whether the form or report has previously saved printer settings. Printer settings for a form or report can be saved two ways: +## Save printer settings with a form or report +Whether a form or report uses the settings of the default application printer (the settings managed with the **Application** object's **Printer** object) is determined by whether the form or report has previously saved printer settings. Printer settings for a form or report can be saved two ways: -- A user can save printer settings by opening the form or report in any view, and using the **Print** or **Page Setup** dialog boxes to change the settings for the form or report. +- A user can save printer settings by opening the form or report in any view, and using the **Print** or **Page Setup** dialog boxes to change the settings for the form or report. -- You can make changes to the **Printer** object of a form or report in code, and those changes will be saved with the form or report if you use the **[Save](../../../api/Access.DoCmd.Save.md)** method before closing the form or report, or specify **acSaveYes** for the _Save_ argument when using the **[Close](../../../api/Access.DoCmd.Close.md)** method to close the form or report. - - - **Note** When printer settings are saved with a form or report, Access creates a new data structure for the form or report to contain the saved settings. Initially, this new data structure contains a copy of all of the settings of the default printer. Any settings the user or your code overrides are saved with the data structure. Access does not maintain any sort of inheritance between settings of the default printer and the settings saved with a form or report. If you change settings of the default printer after saving settings for a form or report, the settings that were originally saved will remain in effect. +- You can make changes to the **Printer** object of a form or report in code, and those changes will be saved with the form or report if you use the **[Save](../../../api/Access.DoCmd.Save.md)** method before closing the form or report, or specify **acSaveYes** for the _Save_ argument when using the **[Close](../../../api/Access.DoCmd.Close.md)** method to close the form or report. +> [!NOTE] +> When printer settings are saved with a form or report, Access creates a new data structure for the form or report to contain the saved settings. Initially, this new data structure contains a copy of all of the settings of the default printer. Any settings the user or your code overrides are saved with the data structure. +> +> Access does not maintain any sort of inheritance between settings of the default printer and the settings saved with a form or report. If you change settings of the default printer after saving settings for a form or report, the settings that were originally saved will remain in effect. -## Determining Whether a Form or Report Has Saved Printer Settings -To determine whether a form or report has saved printer settings, you can read the **UseDefaultPrinter** property of a **Form** or **Report** object using the following syntax: +## Determine whether a form or report has saved printer settings +To determine whether a form or report has saved printer settings, you can read the **UseDefaultPrinter** property of a **Form** or **Report** object by using the following syntax, where _expression_ is any expression that returns a **Form** or **Report** object. ```vb expression .UseDefaultPrinter ``` -Where _expression_ is any expression that returns a **Form** or **Report** object. The **UseDefaultPrinter** property is read/write in Design view and read-only in all other views. - - -## Clearing Saved Printer Settings - -You can also use the **UseDefaultPrinter** property like a method to clear saved settings from a form or report by setting its value to **True**. This is equivalent to opening the **Page Setup** dialog box for the form or report and selecting **Default Printer** on the **Page** tab. +The **UseDefaultPrinter** property is read/write in Design view and read-only in all other views. -You can set the **UseDefaultPrinter** property only when a form or report is open in Design view. The following code fragment opens each of the reports in the current project and clears any report that has saved settings. +## Clear saved printer settings +You can also use the **UseDefaultPrinter** property like a method to clear saved settings from a form or report by setting its value to **True**. This is equivalent to opening the **Page Setup** dialog box for the form or report and selecting **Default Printer** on the **Page** tab. You can set the **UseDefaultPrinter** property only when a form or report is open in Design view. +The following code fragment opens each of the reports in the current project and clears any report that has saved settings. ```vb For Each obj In CurrentProject.AllReports @@ -59,10 +58,11 @@ Next obj ``` -## Preserving Form and Report Printer Settings +## Preserve form and report printer settings -When you programmatically change printer property settings for forms or reports while the object is in any view other than Design view, those changes are automatically saved if the user interactively closes the form or report. The following procedure demonstrates how to save and restore a report's printer settings. +When you programmatically change printer property settings for forms or reports while the object is in any view other than Design view, those changes are automatically saved if the user interactively closes the form or report. +The following procedure demonstrates how to save and restore a report's printer settings. ```vb Sub RestoreReportPrinter() diff --git a/access/Concepts/Reports/create-alternating-row-colors-on-a-report.md b/access/Concepts/Reports/create-alternating-row-colors-on-a-report.md index 11e9652c7f8..83bcc262cd6 100644 --- a/access/Concepts/Reports/create-alternating-row-colors-on-a-report.md +++ b/access/Concepts/Reports/create-alternating-row-colors-on-a-report.md @@ -1,19 +1,17 @@ --- -title: Create Alternating Row Colors on a Report +title: Create alternating row colors on a report ms.prod: access ms.assetid: ea37a0cb-9057-e268-28a7-183751c8a1b8 -ms.date: 06/08/2017 +ms.date: 09/26/2018 --- -# Create Alternating Row Colors on a Report +# Create alternating row colors on a report By default, Access formats each row of a report's detail section with the same background color. When printing a report, shading every other line of the detail section can make it much easier to read. You can use the **[AlternateBackColor](../../../api/Access.Section.AlternateBackColor.md)** property to specify a color to be displayed or printed on every other line in the detail section when viewing or printing a report. The following example illustrates how to display light gray bars on every other line of the report's detail section when it is printed. - - ```vb Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer) diff --git a/access/Concepts/Reports/set-form-report-and-control-properties-in-code.md b/access/Concepts/Reports/set-form-report-and-control-properties-in-code.md index d044403ee98..a8079661a75 100644 --- a/access/Concepts/Reports/set-form-report-and-control-properties-in-code.md +++ b/access/Concepts/Reports/set-form-report-and-control-properties-in-code.md @@ -1,17 +1,17 @@ --- -title: Set Form, Report, and Control Properties in Code +title: Set form, report, and control properties in code ms.prod: access ms.assetid: 23d88ab3-9ee6-5f7f-2351-14bb94d7a27b -ms.date: 06/08/2017 +ms.date: 09/26/2018 --- -# Set Form, Report, and Control Properties in Code +# Set form, report, and control properties in code **[Form](../../../api/Access.Form.md)**, **[Report](../../../api/Access.Report.md)**, and **[Control](../../../api/Access.Control.md)** objects are Access objects. You can set properties for these objects from within a **Sub**, **Function**, or event procedure. You can also set properties for form and report sections. -## To set a property of a form or report +## Set a property of a form or report Refer to the individual form or report within the **[Forms](../../../api/Access.Forms.md)** or **[Reports](../../../api/Access.Reports.md)** collection, followed by the name of the property and its value. For example, to set the **[Visible](../../../api/Access.Form.Visible.md)** property of the Customers form to **True** (-1), use the following line of code: @@ -29,7 +29,7 @@ Me.RecordSource = "SELECT * FROM Customers " _ ``` -## To set a property of a control +## Set a property of a control Refer to the control in the **[Controls](../../../api/Access.Form.Controls.md)** collection of the **Form** or **Report** object on which it resides. You can refer to the **Controls** collection either implicitly or explicitly, but the code executes faster if you use an implicit reference. The following examples set the **Visible** property of a text box called CustomerID on the Customers form: @@ -54,7 +54,7 @@ End With ``` -## To set a property of a form or report section +## Set a property of a form or report section Refer to the form or report within the **Forms** or **Reports** collection, followed by the **Section** property and the integer or constant that identifies the section. The following examples set the **Visible** property of the page header section of the Customers form to **False**: @@ -69,14 +69,14 @@ Me!Section(acPageHeader).Visible = False ``` -- For each property you want to set, you can look up the property in the Help index to find information about: +For each property you want to set, you can look up the property in the Help index to find information about: - - Whether you can set the property from Visual Basic. +- Whether you can set the property from Visual Basic. - - Views in which you can set the property. Not all properties can be set in all views. For example, you can set a form's **BorderStyle** property only in form Design view. +- Views in which you can set the property. Not all properties can be set in all views. For example, you can set a form's **BorderStyle** property only in form Design view. - - Which values you should use to set the property. You often use different settings when you set a property in Visual Basic instead of in the property sheet. For example, if the property settings are selections from a list, you must use the value or numeric equivalent for each selection. +- Which values you should use to set the property. You often use different settings when you set a property in Visual Basic instead of in the property sheet. For example, if the property settings are selections from a list, you must use the value or numeric equivalent for each selection. -- To set default properties for controls from Visual Basic, use the **DefaultControl** property. +To set default properties for controls from Visual Basic, use the **DefaultControl** property. diff --git a/access/Concepts/Settings/activex-data-objects-ado.md b/access/Concepts/Settings/activex-data-objects-ado.md deleted file mode 100644 index fce74eed23d..00000000000 --- a/access/Concepts/Settings/activex-data-objects-ado.md +++ /dev/null @@ -1,17 +0,0 @@ ---- -title: ActiveX Data Objects (ADO) -ms.prod: access -ms.assetid: 7bf30e48-fbe1-4446-8e0d-75e74eb506ac -ms.date: 06/08/2017 ---- - - -# ActiveX Data Objects (ADO) - -- [Bind a form to an ADO Recordset](../ActiveX-Data-Objects/bind-a-form-to-an-ado-recordset.md) -- [Create an ADO connection string](../ActiveX-Data-Objects/create-an-ado-connection-string.md) -- [Set properties of ActiveX Data Objects in Visual Basic](../ActiveX-Data-Objects/set-properties-of-activex-data-objects-in-visual-basic.md) - - - - diff --git a/access/Concepts/Settings/data-access-objects-dao.md b/access/Concepts/Settings/data-access-objects-dao.md deleted file mode 100644 index b528b621732..00000000000 --- a/access/Concepts/Settings/data-access-objects-dao.md +++ /dev/null @@ -1,38 +0,0 @@ ---- -title: Data Access Objects (DAO) -ms.prod: access -ms.assetid: a5096d12-6ffb-42cd-adb1-f886a9b13fca -ms.date: 06/08/2017 ---- - - -# Data Access Objects (DAO) - -- [Add a Record to a DAO Recordset](../Data-Access-Objects/add-a-record-to-a-dao-recordset.md) -- [Build SQL Statements That Include Variables and Controls](../Structured-Query-Language/build-sql-statements-that-include-variables-and-controls.md) -- [Change Tables Involved in a One-to-Many Relationship in a DAO Recordset](../Data-Access-Objects/change-tables-involved-in-a-one-to-many-relationship-in-a-dao-recordset.md) -- [Count the Number of Records in a DAO Recordset](../Data-Access-Objects/count-the-number-of-records-in-a-dao-recordset.md) -- [Create a DAO Recordset From a Form](../Data-Access-Objects/create-a-dao-recordset-from-a-form.md) -- [Create a DAO Recordset From a Query](../Data-Access-Objects/create-a-dao-recordset-from-a-query.md) -- [Create a DAO Recordset From a Table In the Current Database](../Data-Access-Objects/create-a-dao-recordset-from-a-table-in-the-current-database.md) -- [Create a User-Defined Property](../Data-Access-Objects/create-a-user-defined-property.md) -- [Delete a Record From a DAO Recordset](../Data-Access-Objects/delete-a-record-from-a-dao-recordset.md) -- [Detect the Limits of a DAO Recordset](../Data-Access-Objects/detect-the-limits-of-a-dao-recordset.md) -- [Extract Data from a Record in a DAO Recordset](../Data-Access-Objects/extract-data-from-a-record-in-a-dao-recordset.md) -- [Find a Record in a Dynaset-Type or Snapshot-Type DAO Recordset](../Data-Access-Objects/find-a-record-in-a-dynaset-type-or-snapshot-type-dao-recordset.md) -- [Find a Record in a Table-Type DAO Recordset](../Data-Access-Objects/find-a-record-in-a-table-type-dao-recordset.md) -- [Find the Current Position in a DAO Recordset](../Data-Access-Objects/find-the-current-position-in-a-dao-recordset.md) -- [Make Bulk Changes to a DAO Recordset](../Data-Access-Objects/make-bulk-changes-to-a-dao-recordset.md) -- [Manipulate Multivalued Fields With DAO](../Data-Access-Objects/manipulate-multivalued-fields-with-dao.md) -- [Mark a Position in a DAO Recordset](../Data-Access-Objects/mark-a-position-in-a-dao-recordset.md) -- [Modify a Query from a DAO Recordset](../Data-Access-Objects/modify-a-query-from-a-dao-recordset.md) -- [Modify an Existing Record in a DAO Recordset](../Data-Access-Objects/modify-an-existing-record-in-a-dao-recordset.md) -- [Move Through a DAO Recordset](../Data-Access-Objects/move-through-a-dao-recordset.md) -- [Read From and Write To a Field in a DAO Recordset](../Data-Access-Objects/read-from-and-write-to-a-field-in-a-dao-recordset.md) -- [Return a Random Record from a DAO Recordset](../Data-Access-Objects/return-a-random-record-from-a-dao-recordset.md) -- [Set Properties of Data Access Objects in Visual Basic](../Data-Access-Objects/set-properties-of-data-access-objects-in-visual-basic.md) -- [Sort Data in a DAO Recordset](../Data-Access-Objects/sort-data-in-a-dao-recordset.md) -- [Synchronize a DAO Recordset's Record with a Form's Current Record](../Data-Access-Objects/synchronize-a-dao-recordset-s-record-with-a-form-s-current-record.md) -- [Track Design Changes to a Table-Type DAO Recordset](../Data-Access-Objects/track-design-changes-to-a-table-type-dao-recordset.md) -- [Use Transactions in a DAO Recordset](../Data-Access-Objects/use-transactions-in-a-dao-recordset.md) -- [Work With Attachments In DAO](../Data-Access-Objects/work-with-attachments-in-dao.md) diff --git a/access/Concepts/Settings/set-a-reference-to-a-visual-basic-project-in-another-microsoft-access-database-o.md b/access/Concepts/Settings/set-a-reference-to-a-visual-basic-project-in-another-microsoft-access-database-o.md index 2b0d58bcabe..3c4439af5e4 100644 --- a/access/Concepts/Settings/set-a-reference-to-a-visual-basic-project-in-another-microsoft-access-database-o.md +++ b/access/Concepts/Settings/set-a-reference-to-a-visual-basic-project-in-another-microsoft-access-database-o.md @@ -5,7 +5,7 @@ f1_keywords: - vbaac10.chm102162 ms.prod: access ms.assetid: a919be67-84ee-e9de-1cfd-17a456f4d929 -ms.date: 06/08/2017 +ms.date: 09/26/2018 --- diff --git a/access/Concepts/Settings/set-form-report-and-control-properties-in-visual-basic.md b/access/Concepts/Settings/set-form-report-and-control-properties-in-visual-basic.md index f97d746c72b..1ca13cb5194 100644 --- a/access/Concepts/Settings/set-form-report-and-control-properties-in-visual-basic.md +++ b/access/Concepts/Settings/set-form-report-and-control-properties-in-visual-basic.md @@ -5,7 +5,7 @@ f1_keywords: - vbaac10.chm5188061 ms.prod: access ms.assetid: 1f5b5f6b-b424-f35e-4add-21c45b5d74c4 -ms.date: 06/08/2017 +ms.date: 09/26/2018 --- @@ -13,7 +13,7 @@ ms.date: 06/08/2017 **[Form](../../../api/Access.Form.md)**, **[Report](../../../api/Access.Report.md)**, and **[Control](../../../api/Access.Control.md)** objects are Microsoft Access objects. You can set properties for these objects from within a **Sub**, **Function**, or event procedure. You can also set properties for form and report sections. -## To set a property of a form or report +## Set a property of a form or report Refer to the individual form or report within the **[Forms](../../../api/Access.Forms.md)** or **[Reports](../../../api/Access.Reports.md)** collection, followed by the name of the property and its value. For example, to set the **Visible** property of the Customers form to **True** (-1), use the following line of code: @@ -29,7 +29,7 @@ Me.RecordSource = "SELECT * FROM Customers " _ ``` -## To set a property of a control +## Set a property of a control Refer to the control in the **[Controls](../../../api/Access.Controls.md)** collection of the **Form** or **Report** object on which it resides. You can refer to the **Controls** collection either implicitly or explicitly, but the code executes faster if you use an implicit reference. The following examples set the **Visible** property of a text box called CustomerID on the Customers form: @@ -57,7 +57,7 @@ End With ``` -## To set a property of a form or report section +## Set a property of a form or report section Refer to the form or report within the **Forms** or **Reports** collection, followed by the **Section** property and the integer or constant that identifies the section. The following examples set the **Visible** property of the page header section of the Customers form to **False**: diff --git a/access/Concepts/Settings/set-options-from-visual-basic.md b/access/Concepts/Settings/set-options-from-visual-basic.md index 93b317c48a8..a53efccd6b6 100644 --- a/access/Concepts/Settings/set-options-from-visual-basic.md +++ b/access/Concepts/Settings/set-options-from-visual-basic.md @@ -2,7 +2,7 @@ title: Set options from Visual Basic ms.prod: access ms.assetid: c85ab081-6522-f851-a0d7-3d6612af26ab -ms.date: 06/08/2017 +ms.date: 09/26/2018 --- @@ -13,7 +13,7 @@ You can use the **[SetOption](../../../api/Access.Application.SetOption.md)** an The value that you pass to the **SetOption** method as the _setting_ argument depends on which type of option you are setting. The following table establishes some guidelines for setting options. -|**If the option is**|**Then the _setting_ argument is**| +|If the option is|Then the _setting_ argument is| |:-----|:-----| |A text box|A string| |A check box|A Boolean value — **True** (-1) or **False** (0)| @@ -26,196 +26,196 @@ The following tables list the names of all options that can be set or returned f ### Creating databases section -|**Option Text**|**String Argument**| +|Option text|String argument| |:-----|:-----| -|**New database sort order**|New Database Sort Order| -|**Default database folder**|Default Database Directory| -|**Default file format**|Default File Format| +|New database sort order|New Database Sort Order| +|Default database folder|Default Database Directory| +|Default file format|Default File Format| ## Current Database tab ### Application options section -|**Option Text**|**String Argument**| +|Option text|String argument| |:-----|:-----| -|**Compact on Close**|Auto Compact| -|**Remove personal information from file properties on save**|Remove Personal Information| -|**Use Windows-themed Controls on Forms**|Themed Form Controls| -|**Enable Layout View for this database**|DesignWithData| -|**Check for truncated number fields**|CheckTruncatedNumFields| -|**Picture Property Storage Format**|Picture Property Storage Format| +|Compact on Close|Auto Compact| +|Remove personal information from file properties on save|Remove Personal Information| +|Use Windows-themed Controls on Forms|Themed Form Controls| +|Enable Layout View for this database|DesignWithData| +|Check for truncated number fields|CheckTruncatedNumFields| +|Picture Property Storage Format|Picture Property Storage Format| ### Name autoCorrect options section -|**Option Text**|**String Argument**| +|Option text|String argument| |:-----|:-----| -|**Track name AutoCorrect info**|Track Name AutoCorrect Info| -|**Perform name AutoCorrect**|Perform Name AutoCorrect| -|**Log name AutoCorrect changes**|Log Name AutoCorrect Changes| +|Track name AutoCorrect info|Track Name AutoCorrect Info| +|Perform name AutoCorrect|Perform Name AutoCorrect| +|Log name AutoCorrect changes|Log Name AutoCorrect Changes| ### Filter lookup options for `` Database section -|**Option Text**|**String Argument**| +|Option text|String argument| |:-----|:-----| -|**Show list of values in, Local indexed fields**|Show Values in Indexed| -|**Show list of values in, Local nonindexed fields**|Show Values in Non-Indexed| -|**Show list of values in, ODBC fields**|Show Values in Remote| -|**Show list of values in, Records in local snapshot**|Show Values in Snapshot| -|**Show list of values in, Records at server**|Show Values in Server| -|**Don't display lists where more than this number of records read**|Show Values Limit| +|Show list of values in, Local indexed fields|Show Values in Indexed| +|Show list of values in, Local nonindexed fields|Show Values in Non-Indexed| +|Show list of values in, ODBC fields|Show Values in Remote| +|Show list of values in, Records in local snapshot|Show Values in Snapshot| +|Show list of values in, Records at server|Show Values in Server| +|Don't display lists where more than this number of records read|Show Values Limit| ## Datasheet tab ### Default colors section -|**Option Text**|**String Argument**| +|Option text|String argument| |:-----|:-----| -|**Font color**|Default Font Color| -|**Background color**|Default Background Color| -|**Alternate background color**|_64| -|**Gridlines color**|Default Gridlines Color| +|Font color|Default Font Color| +|Background color|Default Background Color| +|Alternate background color|_64| +|Gridlines color|Default Gridlines Color| ### Gridlines and cell effects section -|**Option Text**|**String Argument**| +|Option text|String argument| |:-----|:-----| -|**Default gridlines showing, Horizontal**|Default Gridlines Horizontal| -|**Default gridlines showing, Vertical**|Default Gridlines Vertical| -|**Default cell effect**|Default Cell Effect| -|**Default column width**|Default Column Width| +|Default gridlines showing, Horizontal|Default Gridlines Horizontal| +|Default gridlines showing, Vertical|Default Gridlines Vertical| +|Default cell effect|Default Cell Effect| +|Default column width|Default Column Width| ### Default font section -|**Option Text**|**String Argument**| +|Option text|String argument| |:-----|:-----| -|**Font**|Default Font Name| -|**Size**|Default Font Size| -|**Weight**|Default Font Weight| -|**Underline**|Default Font Underline| -|**Italic**|Default Font Italic| +|Font|Default Font Name| +|Size|Default Font Size| +|Weight|Default Font Weight| +|Underline|Default Font Underline| +|Italic|Default Font Italic| ## Object Designers tab ### Table design section -|**Option Text**|**String Argument**| +|Option text|String argument| |:-----|:-----| -|**Default text field size**|Default Text Field Size| -|**Default number field size**|Default Number Field Size| -|**Default field type**|Default Field Type| -|**AutoIndex on Import/Create**|AutoIndex on Import/Create| -|**Show Property Update Option Buttons**|Show Property Update Options Buttons| +|Default text field size|Default Text Field Size| +|Default number field size|Default Number Field Size| +|Default field type|Default Field Type| +|AutoIndex on Import/Create|AutoIndex on Import/Create| +|Show Property Update Option Buttons|Show Property Update Options Buttons| ### Query design section -|**Option Text**|**String Argument**| +|Option text|String argument| |:-----|:-----| -|**Show table names**|Show Table Names| -|**Output all fields**|Output All Fields| -|**Enable AutoJoin**|Enable AutoJoin| -|**SQL Server Compatible Syntax (ANSI 92), This database**|ANSI Query Mode| -|**SQL Server Compatible Syntax (ANSI 92), Default for new databases**|ANSI Query Mode Default| -|**Query design font, Font**|Query Design Font Name| -|**Query design font, Size**|Query Design Font Size| +|Show table names|Show Table Names| +|Output all fields|Output All Fields| +|Enable AutoJoin|Enable AutoJoin| +|SQL Server Compatible Syntax (ANSI 92), This database|ANSI Query Mode| +|SQL Server Compatible Syntax (ANSI 92), Default for new databases|ANSI Query Mode Default| +|Query design font, Font|Query Design Font Name| +|Query design font, Size|Query Design Font Size| ### Forms/Reports section -|**Option Text**|**String Argument**| +|Option text|String argument| |:-----|:-----| -|**Selection behavior**|Selection Behavior| -|**Form template**|Form Template| -|**Report template**|Report Template| -|**Always use event procedures**|Always Use Event Procedures| +|Selection behavior|Selection Behavior| +|Form template|Form Template| +|Report template|Report Template| +|Always use event procedures|Always Use Event Procedures| ### Error checking section -|**Option Text**|**String Argument**| +|Option text|String argument| |:-----|:-----| -|**Enable error checking**|Enable Error Checking| -|**Error indicator color**|Error Checking Indicator Color| -|**Check for unassociated label and control**|Unassociated Label and Control Error Checking| -|**Check for new unassociated labels**|New Unassociated Labels Error Checking| -|**Check for keyboard shortcut errors**|Keyboard Shortcut Errors Error Checking| -|**Check for invalid control properties**|Invalid Control Properties Error Checking| -|**Check for common report errors**|Common Report Errors Error Checking| +|Enable error checking|Enable Error Checking| +|Error indicator color|Error Checking Indicator Color| +|Check for unassociated label and control|Unassociated Label and Control Error Checking| +|Check for new unassociated labels|New Unassociated Labels Error Checking| +|Check for keyboard shortcut errors|Keyboard Shortcut Errors Error Checking| +|Check for invalid control properties|Invalid Control Properties Error Checking| +|Check for common report errors|Common Report Errors Error Checking| ## Proofing tab ### When correcting spelling in Microsoft Office programs section -|**Option Text**|**String Argument**| +|Option text|String argument| |:-----|:-----| -|**Ignore words in UPPERCASE**|Spelling ignore words in UPPERCASE| -|**Ignore words that contain numbers**|Spelling ignore words with number| -|**Ignore Internet and file addresses**|Spelling ignore Internet and file addresses| -|**Suggest from main dictionary only**|Spelling suggest from main dictionary only| -|**Dictionary Language**|Spelling dictionary language| +|Ignore words in UPPERCASE|Spelling ignore words in UPPERCASE| +|Ignore words that contain numbers|Spelling ignore words with number| +|Ignore Internet and file addresses|Spelling ignore Internet and file addresses| +|Suggest from main dictionary only|Spelling suggest from main dictionary only| +|Dictionary Language|Spelling dictionary language| ## Advanced tab ### Editing section -|**Option Text**|**String Argument**| -|:-----|:-----| -|**Move after enter**|Move After Enter| -|**Behavior entering field**|Behavior Entering Field| -|**Arrow key behavior**|Arrow Key Behavior| -|**Cursor stops at first/last field**|Cursor Stops at First/Last Field| -|**Default find/replace behavior**|Default Find/Replace Behavior| -|**Confirm, Record changes**|Confirm Record Changes| -|**Confirm, Document deletions**|Confirm Document Deletions| -|**Confirm, Action queries**|Confirm Action Queries| -|**Default direction**|Default Direction| -|**General alignment**|General Alignment| -|**Cursor movement**|Cursor Movement| -|**Datasheet IME control**|Datasheet Ime Control| -|**Use Hijri Calendar**|Use Hijri Calendar| +|Option text|String argument| +|:-----|:-----| +|Move after enter|Move After Enter| +|Behavior entering field|Behavior Entering Field| +|Arrow key behavior|Arrow Key Behavior| +|Cursor stops at first/last field|Cursor Stops at First/Last Field| +|Default find/replace behavior|Default Find/Replace Behavior| +|Confirm, Record changes|Confirm Record Changes| +|Confirm, Document deletions|Confirm Document Deletions| +|Confirm, Action queries|Confirm Action Queries| +|Default direction|Default Direction| +|General alignment|General Alignment| +|Cursor movement|Cursor Movement| +|Datasheet IME control|Datasheet Ime Control| +|Use Hijri Calendar|Use Hijri Calendar| ### Display section -|**Option Text**|**String Argument**| +|Option text|String argument| |:-----|:-----| -|**Show this number of Recent Documents**|Size of MRU File List| -|**Status bar**|Show Status Bar| -|**Show animations**|Show Animations| -|**Show Smart Tags on Datasheets**|Show Smart Tags on Datasheets| -|**Show Smart Tags on Forms and Reports**|Show Smart Tags on Forms and Reports| -|**Show in Macro Design, Names column**|Show Macro Names Column| -|**Show in Macro Design, Conditions column**|Show Conditions Column| +|Show this number of Recent Documents|Size of MRU File List| +|Status bar|Show Status Bar| +|Show animations|Show Animations| +|Show Smart Tags on Datasheets|Show Smart Tags on Datasheets| +|Show Smart Tags on Forms and Reports|Show Smart Tags on Forms and Reports| +|Show in Macro Design, Names column|Show Macro Names Column| +|Show in Macro Design, Conditions column|Show Conditions Column| ### Printing section -|**Option Text**|**String Argument**| +|Option text|String argument| |:-----|:-----| -|**Left margin**|Left Margin| -|**Right margin**|Right Margin| -|**Top margin**|Top Margin| -|**Bottom margin**|Bottom Margin| +|Left margin|Left Margin| +|Right margin|Right Margin| +|Top margin|Top Margin| +|Bottom margin|Bottom Margin| ### General section -|**Option Text**|**String Argument**| +|Option text|String argument| |:-----|:-----| -|**Provide feedback with sound**|Provide Feedback with Sound| -|**Use four-year digit year formatting, This database**|Four-Digit Year Formatting| -|**Use four-year digit year formatting, All databases**|Four-Digit Year Formatting All Databases| +|Provide feedback with sound|Provide Feedback with Sound| +|Use four-year digit year formatting, This database|Four-Digit Year Formatting| +|Use four-year digit year formatting, All databases|Four-Digit Year Formatting All Databases| ### Advanced section -|**Option Text**|**String Argument**| -|:-----|:-----| -|**Open last used database when Access starts**|Open Last Used Database When Access Starts| -|**Default open mode**|Default Open Mode for Databases| -|**Default record locking**|Default Record Locking| -|**Open databases by using record-level locking**|Use Row Level Locking| -|**OLE/DDE timeout (sec)**|OLE/DDE Timeout (sec)| -|**Refresh interval (sec)**|Refresh Interval (sec)| -|**Number of update retries**|Number of Update Retries| -|**ODBC refresh interval (sec)**|ODBC Refresh Interval (sec)| -|**Update retry interval (msec)**|Update Retry Interval (msec)| -|**DDE operations, Ignore DDE requests**|Ignore DDE Requests| -|**DDE operations, Enable DDE refresh**|Enable DDE Refresh| -|**Command-line arguments**|Command-Line Arguments| +|Option text|String argument| +|:-----|:-----| +|Open last used database when Access starts|Open Last Used Database When Access Starts| +|Default open mode|Default Open Mode for Databases| +|Default record locking|Default Record Locking| +|Open databases by using record-level locking|Use Row Level Locking| +|OLE/DDE timeout (sec)|OLE/DDE Timeout (sec)| +|Refresh interval (sec)|Refresh Interval (sec)| +|Number of update retries|Number of Update Retries| +|ODBC refresh interval (sec)|ODBC Refresh Interval (sec)| +|Update retry interval (msec)|Update Retry Interval (msec)| +|DDE operations, Ignore DDE requests|Ignore DDE Requests| +|DDE operations, Enable DDE refresh|Enable DDE Refresh| +|Command-line arguments|Command-Line Arguments| > [!NOTE] diff --git a/access/Concepts/Settings/set-properties-by-using-visual-basic.md b/access/Concepts/Settings/set-properties-by-using-visual-basic.md index 22fe48658ce..520cb926eca 100644 --- a/access/Concepts/Settings/set-properties-by-using-visual-basic.md +++ b/access/Concepts/Settings/set-properties-by-using-visual-basic.md @@ -1,21 +1,23 @@ --- -title: Set Properties by Using Visual Basic +title: Set properties by using Visual Basic keywords: vbaac10.chm5188064 f1_keywords: - vbaac10.chm5188064 ms.prod: access ms.assetid: 3fa3677b-a779-3bc7-0f0f-827c252b3292 -ms.date: 06/08/2017 +ms.date: 09/26/2018 --- -# Set Properties by Using Visual Basic +# Set properties by using Visual Basic -You can set most properties from Visual Basic code. How you set a property depends on whether you are setting it for a [Form](../../../api/Access.Form.md), [Report](../../../api/Access.Report.md), [Control](../../../api/Access.Control.md), [ActiveX Data Objects (ADO)](activex-data-objects-ado.md), or [Data Access Objects (DAO)](data-access-objects-dao.md). The following topics outline the steps involved for setting properties of each type of object: +You can set most properties from Visual Basic code. How you set a property depends on whether you are setting it for a [Form](../../../api/Access.Form.md), [Report](../../../api/Access.Report.md), [Control](../../../api/Access.Control.md), [ActiveX Data Objects (ADO)](activex-data-objects-ado.md), or [Data Access Objects (DAO)](data-access-objects-dao.md). -- [Set Form, Report, and Control Properties in Visual Basic](set-form-report-and-control-properties-in-visual-basic.md) +The following topics outline the steps involved for setting properties of each type of object: -- [Set Properties of ActiveX Data Objects in Visual Basic](../ActiveX-Data-Objects/set-properties-of-activex-data-objects-in-visual-basic.md) +- [Set form, report, and control properties in Visual Basic](set-form-report-and-control-properties-in-visual-basic.md) -- [Set Properties of Data Access Objects in Visual Basic](../Data-Access-Objects/set-properties-of-data-access-objects-in-visual-basic.md) +- [Set properties of ActiveX Data Objects in Visual Basic](../ActiveX-Data-Objects/set-properties-of-activex-data-objects-in-visual-basic.md) + +- [Set properties of Data Access Objects in Visual Basic](../Data-Access-Objects/set-properties-of-data-access-objects-in-visual-basic.md) diff --git a/access/Concepts/Settings/set-references-to-type-libraries.md b/access/Concepts/Settings/set-references-to-type-libraries.md index a35c53dae41..342c506e5a4 100644 --- a/access/Concepts/Settings/set-references-to-type-libraries.md +++ b/access/Concepts/Settings/set-references-to-type-libraries.md @@ -1,40 +1,41 @@ --- -title: Set References to Type Libraries +title: Set references to type libraries keywords: vbaac10.chm13780 f1_keywords: - vbaac10.chm13780 ms.prod: access ms.assetid: 6314a89b-89e9-d8c1-5964-889a361afcd1 -ms.date: 06/08/2017 +ms.date: 09/26/2018 --- -# Set References to Type Libraries +# Set references to type libraries When you set a reference to another application's type library, you can use the objects supplied by that application in your code. For example, if you set a reference from Access to the Excel library, you can then use Excel objects through Automation (formerly called OLE Automation). If you set a reference to a Visual Basic project in another Access database, you can call its public procedures. If you set a reference to an ActiveX control, you can use that control on Access forms. You can set a reference from Access while the Visual Basic Editor is open, or you can set a reference in Visual Basic code. -## Setting a Reference from Access +## Set a reference from Access To set a reference to an application's type library: - -1. On the **Tools** menu, click **References**. The **References** command on the **Tools** menu is available only when a Module window is open and active in Design view. +1. On the **Tools** menu, select **References**. The **References** command on the **Tools** menu is available only when a Module window is open and active in Design view. 2. Select the check boxes for those applications whose type libraries you want to reference. -## Setting a Reference from Visual Basic +## Set a reference from Visual Basic To set a reference from Visual Basic, you create a new **Reference** object representing the desired reference. The **References** collection contains all currently set references. To create a new **Reference** object, use either the **AddFromFile** or **AddFromGUID** method of the **References** collection. To remove a **Reference** object, use the **Remove** method. -## Advantages of Setting References +## Advantages of setting references + +Your Automation code will run faster if you set a reference to another application's type library before you work with its objects. If you've set a reference, you can declare an object variable representing an object in the other application as its most specific type. -Your Automation code will run faster if you set a reference to another application's type library before you work with its objects. If you've set a reference, you can declare an object variable representing an object in the other application as its most specific type. For example, if you're writing code to work with Excel objects, you can declare an object variable of type **Excel.Application** by using the following syntax only if you've created a reference to the Excel type library: +For example, if you're writing code to work with Excel objects, you can declare an object variable of type **Excel.Application** by using the following syntax only if you've created a reference to the Excel type library: ```vb @@ -43,15 +44,12 @@ Dim appXL As New Excel.Application If you haven't set a reference to the Excel type library, you must declare the variable as a generic variable of type **Object**. The following code runs more slowly: - - - ```vb Dim appXL As Object ``` Additionally, if you set a reference to an application's type library, all of its objects, as well as their methods and properties, are listed in the Object Browser. This makes it easy to determine what properties and methods are available to each object. -Since Access is an COM component that supports Automation, you can also set a reference to its type library from another application and work with Access objects from that application. +Because Access is a COM component that supports automation, you can also set a reference to its type library from another application and work with Access objects from that application. diff --git a/access/Concepts/Settings/set-startup-properties-and-options-in-code.md b/access/Concepts/Settings/set-startup-properties-and-options-in-code.md index e3968b47b1e..777209bc1bd 100644 --- a/access/Concepts/Settings/set-startup-properties-and-options-in-code.md +++ b/access/Concepts/Settings/set-startup-properties-and-options-in-code.md @@ -1,22 +1,24 @@ --- -title: Set Startup Properties and Options in Code +title: Set startup properties and options in code keywords: vbaac10.chm5188070 f1_keywords: - vbaac10.chm5188070 ms.prod: access ms.assetid: 6b6e50d6-27b5-337b-e95e-5e100c958713 -ms.date: 06/08/2017 +ms.date: 09/26/2018 --- -# Set Startup Properties and Options in Code +# Set startup properties and options in code -Startup properties affect how your database application appears when it's opened. For example, startup properties enable you to customize the application's title bar, menus, toolbars, and startup form. The startup properties are available in the Current Database category of the **Access Options** dialog box. To view the **Access Options** dialog box, click the **Microsoft Office Button** and then click **Access Options**. +Startup properties affect how your database application appears when it's opened. For example, startup properties enable you to customize the application's title bar, menus, toolbars, and startup form. The startup properties are available in the Current Database category of the **Access Options** dialog box. + +To view the **Access Options** dialog box, select the **Microsoft Office Button**, and then select **Access Options**. You can set options in the **Access Options** dialog box to change various aspects of the application's environment while you're working in it. For example, you can set form, report, table, and query default options. The following topics provide specific information about setting startup properties and options in code. -- [Set Startup Properties from Visual Basic](set-startup-properties-and-options-in-code.md) -- [Set Options from Visual Basic](set-options-from-visual-basic.md) +- [Set startup properties from Visual Basic](set-startup-properties-and-options-in-code.md) +- [Set options from Visual Basic](set-options-from-visual-basic.md) diff --git a/access/Concepts/Windows-API/determine-when-a-shelled-process-ends.md b/access/Concepts/Windows-API/determine-when-a-shelled-process-ends.md index 95b5a698665..13f8b9ffebb 100644 --- a/access/Concepts/Windows-API/determine-when-a-shelled-process-ends.md +++ b/access/Concepts/Windows-API/determine-when-a-shelled-process-ends.md @@ -1,121 +1,119 @@ --- -title: Determine When a Shelled Process Ends +title: Determine when a shelled process ends ms.prod: access ms.assetid: 16a6fb03-0ff5-76a9-8efb-9348d5a6beef -ms.date: 06/08/2017 +ms.date: 09/26/2018 --- -# Determine When a Shelled Process Ends +# Determine when a shelled process ends -When you run the **[Shell](../../../language/reference/User-Interface-Help/shell-function.md)** function in a Visual Basic for Applications (VBA) procedure, it starts an executable program asynchronously and returns control to the procedure. This shelled program continues to run independently of your procedure until you close it. +When you run the **[Shell](../../../language/reference/User-Interface-Help/shell-function.md)** function in a Visual Basic for Applications (VBA) procedure, it starts an executable program asynchronously and returns control to the procedure. This shelled program continues to run independently of your procedure until you close it. If your procedure needs to wait for the shelled process to end, you can use the Windows API to poll the status of the application, but this is not very efficient. This topic explains a more efficient method. -The Windows API has integrated functionality that enables your application to wait until a shelled process has completed. To use these functions, you need to have a handle to the shelled process. To accomplish this, use the **CreateProcess** function instead of the **Shell** function to begin your shelled program. - - -## Creating the Shelled Process - -To create an addressable process, use the **CreateProcess** function to start your shelled application. The **CreateProcess** function gives your program the process handle of the shelled process via one of its passed parameters. - - -## Waiting for the Shelled Process to End - -After you use the **CreateProcess** function to get a process handle, you can pass that handle to the **WaitForSingleObject** function. This causes your VBA procedure to suspend execution until the shelled process ends. - -The following steps are necessary to build a VBA procedure that uses the **CreateProcess** function to run the Windows Notepad application. This code shows how to use the Windows API **CreateProcess** and **WaitForSingleObject** functions to wait until a shelled process ends before resuming execution. - -The syntax of the **CreateProcess** function is complex, so in the example code, it is encapsulated into a function called **ExecCmd**. **ExecCmd** takes one parameter, the command line of the application to execute. - -Create a standard module and paste the following lines in the Declarations section: - - - - -```vb -Option Explicit - -Private Type STARTUPINFO - cb As Long - lpReserved As String - lpDesktop As String - lpTitle As String - dwX As Long - dwY As Long - dwXSize As Long - dwYSize As Long - dwXCountChars As Long - dwYCountChars As Long - dwFillAttribute As Long - dwFlags As Long - wShowWindow As Integer - cbReserved2 As Integer - lpReserved2 As Long - hStdInput As Long - hStdOutput As Long - hStdError As Long -End Type - -Private Type PROCESS_INFORMATION - hProcess As Long - hThread As Long - dwProcessID As Long - dwThreadID As Long -End Type - -Private Declare Function WaitForSingleObject Lib "kernel32" (ByVal _ - hHandle As Long, ByVal dwMilliseconds As Long) As Long - -Private Declare Function CreateProcessA Lib "kernel32" (ByVal _ - lpApplicationName As Long, ByVal lpCommandLine As String, ByVal _ - lpProcessAttributes As Long, ByVal lpThreadAttributes As Long, _ - ByVal bInheritHandles As Long, ByVal dwCreationFlags As Long, _ - ByVal lpEnvironment As Long, ByVal lpCurrentDirectory As Long, _ - lpStartupInfo As STARTUPINFO, lpProcessInformation As _ - PROCESS_INFORMATION) As Long - -Private Declare Function CloseHandle Lib "kernel32" (ByVal _ - hObject As Long) As Long - -Private Const NORMAL_PRIORITY_CLASS = &H20& -Private Const INFINITE = -1& - -``` - -Paste the following code into the module: - - - - -```vb -Public Sub ExecCmd(cmdline As String) - Dim proc As PROCESS_INFORMATION - Dim start As STARTUPINFO - Dim ReturnValue As Integer - - ' Initialize the STARTUPINFO structure: - start.cb = Len(start) - - ' Start the shelled application: - ReturnValue = CreateProcessA(0&, cmdline$, 0&, 0&, 1&, _ - NORMAL_PRIORITY_CLASS, 0&, 0&, start, proc) - - ' Wait for the shelled application to finish: - Do - ReturnValue = WaitForSingleObject(proc.hProcess, 0) - DoEvents - Loop Until ReturnValue <> 258 - - ReturnValue = CloseHandle(proc.hProcess) -End Sub - -Sub Testing() - ExecCmd "NOTEPAD.EXE" - MsgBox "Process Finished" -End Sub -``` - -Type **Testing** in the **Immediate** window. Notepad will start. After you close Notepad, a message box will notify you that the process has completed. +The Windows API has integrated functionality that enables your application to wait until a shelled process has completed. To use these functions, you need to have a handle to the shelled process. To accomplish this, use the **CreateProcess** function instead of the **Shell** function to begin your shelled program. + + +## Create the shelled process + +To create an addressable process, use the **CreateProcess** function to start your shelled application. The **CreateProcess** function gives your program the process handle of the shelled process via one of its passed parameters. + + +## Wait for the shelled process to end + +After you use the **CreateProcess** function to get a process handle, you can pass that handle to the **WaitForSingleObject** function. This causes your VBA procedure to suspend execution until the shelled process ends. + +The following steps are necessary to build a VBA procedure that uses the **CreateProcess** function to run the Windows Notepad application. This code shows how to use the Windows API **CreateProcess** and **WaitForSingleObject** functions to wait until a shelled process ends before resuming execution. + +The syntax of the **CreateProcess** function is complex, so in the example code, it is encapsulated into a function called **ExecCmd**. **ExecCmd** takes one parameter, the command line of the application to execute. + +1. Create a standard module and paste the following lines in the Declarations section: + + ```vb + Option Explicit + + Private Type STARTUPINFO + cb As Long + lpReserved As String + lpDesktop As String + lpTitle As String + dwX As Long + dwY As Long + dwXSize As Long + dwYSize As Long + dwXCountChars As Long + dwYCountChars As Long + dwFillAttribute As Long + dwFlags As Long + wShowWindow As Integer + cbReserved2 As Integer + lpReserved2 As Long + hStdInput As Long + hStdOutput As Long + hStdError As Long + End Type + + Private Type PROCESS_INFORMATION + hProcess As Long + hThread As Long + dwProcessID As Long + dwThreadID As Long + End Type + + Private Declare Function WaitForSingleObject Lib "kernel32" (ByVal _ + hHandle As Long, ByVal dwMilliseconds As Long) As Long + + Private Declare Function CreateProcessA Lib "kernel32" (ByVal _ + lpApplicationName As Long, ByVal lpCommandLine As String, ByVal _ + lpProcessAttributes As Long, ByVal lpThreadAttributes As Long, _ + ByVal bInheritHandles As Long, ByVal dwCreationFlags As Long, _ + ByVal lpEnvironment As Long, ByVal lpCurrentDirectory As Long, _ + lpStartupInfo As STARTUPINFO, lpProcessInformation As _ + PROCESS_INFORMATION) As Long + + Private Declare Function CloseHandle Lib "kernel32" (ByVal _ + hObject As Long) As Long + + Private Const NORMAL_PRIORITY_CLASS = &H20& + Private Const INFINITE = -1& + + ``` + +
+ +2. Paste the following code into the module: + + ```vb + Public Sub ExecCmd(cmdline As String) + Dim proc As PROCESS_INFORMATION + Dim start As STARTUPINFO + Dim ReturnValue As Integer + + ' Initialize the STARTUPINFO structure: + start.cb = Len(start) + + ' Start the shelled application: + ReturnValue = CreateProcessA(0&, cmdline$, 0&, 0&, 1&, _ + NORMAL_PRIORITY_CLASS, 0&, 0&, start, proc) + + ' Wait for the shelled application to finish: + Do + ReturnValue = WaitForSingleObject(proc.hProcess, 0) + DoEvents + Loop Until ReturnValue <> 258 + + ReturnValue = CloseHandle(proc.hProcess) + End Sub + + Sub Testing() + ExecCmd "NOTEPAD.EXE" + MsgBox "Process Finished" + End Sub + ``` + +
+ +3. Type **Testing** in the **Immediate** window. Notepad starts. After you close Notepad, a message box notifies you that the process has completed. diff --git a/access/Concepts/Windows-API/retrieve-information-from-the-clipboard.md b/access/Concepts/Windows-API/retrieve-information-from-the-clipboard.md index 8807a8081fd..33abce2ce0a 100644 --- a/access/Concepts/Windows-API/retrieve-information-from-the-clipboard.md +++ b/access/Concepts/Windows-API/retrieve-information-from-the-clipboard.md @@ -1,17 +1,18 @@ --- -title: Retrieve Information from the Clipboard +title: Retrieve information from the Clipboard ms.prod: access ms.assetid: 593d3047-c6c8-ab22-cdeb-aadc8b56ca81 -ms.date: 06/08/2017 +ms.date: 09/26/2018 --- -# Retrieve Information from the Clipboard +# Retrieve information from the Clipboard -## Using the RunCommand Method +## Use the RunCommand method -You can use the **[RunCommand](../../../api/Access.DoCmd.RunCommand.md)** method with the **acCmdPaste** constant to paste the contents of the Clipboard into the active control on a form or report. The following example illustrates how to paste the contents of the Clipboard into a text box named txtNotes. +You can use the **[RunCommand](../../../api/Access.DoCmd.RunCommand.md)** method with the **acCmdPaste** constant to paste the contents of the Clipboard into the active control on a form or report. +The following example illustrates how to paste the contents of the Clipboard into a text box named txtNotes. ```vb Private Sub cmdPaste_Click() @@ -21,11 +22,10 @@ End Sub ``` -## Using the Windows API +## Use the Windows API To use API calls to retrieve information from the Clipboard, paste the following code into the Declarations section of a standard module. - ```vb Declare Function OpenClipboard Lib "User32" (ByVal hwnd As Long) _ As Long @@ -48,10 +48,9 @@ Public Const CF_TEXT = 1 Public Const MAXSIZE = 4096 ``` -Paste the following code into a standard module. - - +
+Paste the following code into a standard module. ```vb Function ClipBoard_GetData() diff --git a/access/Concepts/Windows-API/retrieve-the-name-of-the-user-logged-on-to-the-network.md b/access/Concepts/Windows-API/retrieve-the-name-of-the-user-logged-on-to-the-network.md index 13a13dc533f..78b166b7738 100644 --- a/access/Concepts/Windows-API/retrieve-the-name-of-the-user-logged-on-to-the-network.md +++ b/access/Concepts/Windows-API/retrieve-the-name-of-the-user-logged-on-to-the-network.md @@ -1,14 +1,14 @@ --- -title: Retrieve the Name of the User Logged On To the Network +title: Retrieve the name of the user signed in to the network ms.prod: access ms.assetid: 3bf335a1-08d0-c8d5-8d89-36f0c29d47d0 -ms.date: 06/08/2017 +ms.date: 09/26/2018 --- -# Retrieve the Name of the User Logged On To the Network +# Retrieve the name of the user signed in to the network -This topic contians a user-defined function, GetLogonName, that returns the current user name. The GetLogonName function utilizes the GetUserNameA Windows API to retrieve the current user name. +This topic contians a user-defined function, GetLogonName, that returns the current user name. The GetLogonName function utilizes the **GetUserNameA** Windows API to retrieve the current user name. ```vb diff --git a/access/Concepts/Windows-API/send-information-to-the-clipboard.md b/access/Concepts/Windows-API/send-information-to-the-clipboard.md index 4b710a908b6..114482ec0de 100644 --- a/access/Concepts/Windows-API/send-information-to-the-clipboard.md +++ b/access/Concepts/Windows-API/send-information-to-the-clipboard.md @@ -1,16 +1,18 @@ --- -title: Send Information to the Clipboard +title: Send information to the Clipboard ms.prod: access ms.assetid: 4261f071-7bff-b290-c3d3-03645fd9ada0 -ms.date: 06/08/2017 +ms.date: 09/26/2018 --- -# Send Information to the Clipboard +# Send information to the Clipboard -## Use the RunCommand Method +## Use the RunCommand method -You can use the **[RunCommand](../../../api/Access.DoCmd.RunCommand.md)** method with the **acCmdCopy** constant to copy the contents of the active control on a form or report to the Clipboard. The following example illustrates how to copy the contents of a text box named txtNotes to the Clipboard. +You can use the **[RunCommand](../../../api/Access.DoCmd.RunCommand.md)** method with the **acCmdCopy** constant to copy the contents of the active control on a form or report to the Clipboard. + +The following example illustrates how to copy the contents of a text box named txtNotes to the Clipboard. ```vb diff --git a/access/Concepts/XML/export-a-report-to-xml.md b/access/Concepts/XML/export-a-report-to-xml.md index 753bb474437..0797ceec1fc 100644 --- a/access/Concepts/XML/export-a-report-to-xml.md +++ b/access/Concepts/XML/export-a-report-to-xml.md @@ -1,14 +1,20 @@ --- -title: Export a Report to XML +title: Export a report to XML ms.prod: access ms.assetid: 7e746a40-6227-1481-f631-702c3cf42d0f -ms.date: 06/08/2017 +ms.date: 09/26/2018 --- -# Export a Report to XML +# Export a report to XML -This procedure exports the Invoice report in the current database to an XML file. It also exports presentation information, and places images in the Images folder. The procedure exports the report to the default HTML wrapper. In addition, it creates a file containing the ReportML list. +This procedure does the following: + +- Exports the Invoice report in the current database to an XML file. +- Exports presentation information. +- Places images in the Images folder. +- Exports the report to the default HTML wrapper. +- Creates a file containing the ReportML list. ```vb diff --git a/access/Concepts/XML/export-data-schema-and-related-tables-to-xml.md b/access/Concepts/XML/export-data-schema-and-related-tables-to-xml.md index d288a81b400..a45b6d8b8f9 100644 --- a/access/Concepts/XML/export-data-schema-and-related-tables-to-xml.md +++ b/access/Concepts/XML/export-data-schema-and-related-tables-to-xml.md @@ -1,22 +1,19 @@ --- -title: Export Data, Schema, and Related Tables to XML +title: Export data, schema, and related tables to XML ms.prod: access ms.assetid: 4f84813a-bc39-ac03-f04f-624f74eed190 -ms.date: 06/08/2017 +ms.date: 09/26/2018 --- -# Export Data, Schema, and Related Tables to XML +# Export data, schema, and related tables to XML -The **[ExportXML](../../../api/Access.Application.ExportXML.md)** method can be used to export the data and formatting contained in a table, along with any additonal data that you specify. +The **[ExportXML](../../../api/Access.Application.ExportXML.md)** method can be used to export the data and formatting contained in a table, along with any additional data that you specify. -To specify the additional data to export, you must must use the **[CreateAdditionalData](../../../api/Access.Application.CreateAdditionalData.md)** method to create an **[AdditionalData](../../../api/Access.AdditionalData.md)** object. Then, use the **[Add](../../../api/Access.AdditionalData.Add.md)** method to add additonal tables to export along with the main table. +To specify the additional data to export, you must must use the **[CreateAdditionalData](../../../api/Access.Application.CreateAdditionalData.md)** method to create an **[AdditionalData](../../../api/Access.AdditionalData.md)** object. Then, use the **[Add](../../../api/Access.AdditionalData.Add.md)** method to add additional tables to export along with the main table. The following procedure illustrates how to include additional data when exporting a table to XML. The Orders table is exported along with several other tables. The schema and the formatting are also exported as separate .xsd and .xsl files, respectively. - - - ```vb Private Sub ExportRelTables() ' Purpose: Exports the Orders table as well as @@ -43,7 +40,7 @@ Private Sub ExportRelTables() .Add "Categories" End With - ' Export the Orders table along with the addtional data. + ' Export the Orders table along with the additional data. Application.ExportXml acExportTable, "Orders", _ "C:\Orders.xml", "C:\OrdersSchema.xsd", _ "C:\OrdersStyle.xsl", AdditionalData:= objAD diff --git a/api/TOC.md b/api/TOC.md index 5d66620e7de..de4763913d0 100644 --- a/api/TOC.md +++ b/api/TOC.md @@ -108,8 +108,6 @@ ##### [Create alternating row colors on a report](../access/Concepts/Reports/create-alternating-row-colors-on-a-report.md) ##### [Set form, report, and control properties in code](../access/Concepts/Reports/set-form-report-and-control-properties-in-code.md) #### Settings -##### [ActiveX Data Objects (ADO)](../access/Concepts/Settings/activex-data-objects-ado.md) -##### [Data Access Objects (DAO)](../access/Concepts/Settings/data-access-objects-dao.md) ##### [Set a reference to a Visual Basic project in another Access database or project](../access/Concepts/Settings/set-a-reference-to-a-visual-basic-project-in-another-microsoft-access-database-o.md) ##### [Set form, report, and control properties in Visual Basic](../access/Concepts/Settings/set-form-report-and-control-properties-in-visual-basic.md) ##### [Set options from Visual Basic](../access/Concepts/Settings/set-options-from-visual-basic.md)