Vba Ms Access Setproperty Continuous Form Single Line

2.3 Microsoft Access Form Properties

Every element or object on a form or report in MS Access has a set of properties associated with it. On a form, there are "form level" properties that apply to the entire form. Each label, text box, combo box and other object on a form also have their own set of properties. To view the Form level properties, right-click on the form in Design View and selectProperties from the pop-up menu. If theSelection Type does not sayForm then pull down the list below and selectForm from the list. Finally click on theData tab as shown below:

Access form level properties data

TheData tab displays properties of the form related to the data that is used to populate the form and how the data is to be displayed and manipulated. Access has already set all of these properties when the form was created by the Forms Wizard. So by default there may not be a reason at this point to change any of the properties. However in later steps we may come back to this property page to make some changes. For now, a few of the more important and useful properties to be aware of are:

Property Description
Record Source The source of data for the form. Forms may only have one source of data "bound" to the fields on the form. This source can be a query but most of the time it will be a table.
Recordset Type The type of Recordset object created from the record source. In virtually all cases this should be set to Dynaset since a Dynaset maintains consistency with the underlying table. A snapshot just shows the data at the time the form is opened so no data changes are reflected until the form is re-opened or refreshed.
Fetch Defaults Yes indicates default values set in the underlying table will be populated in the fields when a new record is created.
Filter Sets any filtering criteria for when the form is opened. For example, one might set a filter to only show "Money Market" account types for a particular form. By default no filters are applied but can be added by the user once the form is displayed.
Filter on load If a filter is set,Yes indicates the filter will be applied as the form is loading.
Order By Specifies the order of the records as they are displayed in the form. For example, putting "CustomerID" for this property will cause the form to display the Accounts records ordered by CustomerID.
Data Entry Yes indicates the form canonly be used to add new data records.No is the default.
Allow Additions Yes indicates this form can be used to add new records.
Allow Deletions Yes indicates this form can be used to delete existing records.
Allow Edits Yes indicates this form can be used to edit existing records.
Allow Filters Yes indicates users can add filters to diplsay a subset of the records in the form.
Record Locks Indicates how data should be locked when multiple users are working on the same data. Locks are used to prevent two users from overwriting the same data.
No Locks indicates no locking is done. This is the default but may not be reasonable if you plan to share this data with multiple users.
All Records indicates all records in the table are locked when a user edits one record.
Edited Record indicates only the current record being edited will be locked.

TheFormat properties tab for a form controls the appearance of the form including scrollbars, headings, default layout of fields, etc. Some handy properties include:

Property Description
Caption Form Caption – this is the name that appears on the top tab when the form is open.
Default View Default view when form is opened. Can be:
Single Form
Continuous Form
Data Sheet
split Form
Allow Form View Yes indicates the regular form view is allowed.
Allow Datasheet View Yes indicates the form can be shown as a data sheet.
Allow Layout View Yes indicates the form can be switched to Layout view.
Scroll Bars Can beNeither,Horizontal,Vertical orBoth
Close Button Yes indicates a Close button will appear in the upper right corner of the form.

The other property tabs on the Form Properties sheet include:

  • Events – Properties to control macros and Visual Basic for Applications (VBA) code in response to certain events on the form. We will revisit Events in a later tutorial.
  • Other – Properties to control other appearance aspects such as the inclusion of custom menu bars, ribbon bars, help files and printing defaults.

In later tutorials such as this one, we revisit these form-level properties to customize how the form behaves.

2.4 Field Properties

While form-level properties apply to entire forms, the field-level properties apply to specific fields. if the Property Sheet is no longer open, right-click on the CustomerID field and selectProperties from the pop-up menu. If the Property Sheet is already displayed then simply click once on the CustomerID field. TheData tab for CustomerID properties is shown below:

Access field level properties data

As with the form-level properties, Access sets the default properties for each field during the Forms Wizard process to create a new form. Most of these properties can (and probably should) be left with their default values. However a few properties will be modified to change the behavior of the fields.

Property Description
Control Source The source of data for the field. The choices here are limited to the columns available in the table (or query) specified in the form-level Record Source property. In this example, the CustomerID is sourced (orbound to the CustomerID column in the Accounts table.
Row Source
Row Source Type
Bound Column
Properties that control the source of values for the Combo Box. In this case the first column of the Customer table is used to populate the CustomerID field on the Accounts table. Note that this set of properties were set by the table design properties introduced in the Advanced Database Table Design tutorial
Input Mask Set a template for data to be input. A "0" is used to indicate a mandatory numeric digit. "9" indicates an optional digit. "L" indicates a mandatory letter. "?" indicates an optional letter.
For example, a mask for a U.S. telephone number might be(999) 000-0000;0;-:. Setting theInput Mask on the AccountNumber field to0000 forces the user to enter a 4-digit number:
Access field input mask
This Microsoft article discusses input masks in detail.
Default Value Specifies a default value for new records. This can also be set in the table level properties.
Validation Rule and
Validation Text
Sets a validation rule for data entered by the user. For example, this can be used to limit the range of values for a particular field. Note that these are similar to the properties that are set by the table design properties introduced in the Advanced Database Table Design tutorial
Enabled Yes indicates the field is available in form view.
Locked Yes indicates the data in the field is locked and can not be change.
Auto Expand Yesindicates a value will be pre-filled if the first few letters are typed in. For example, when enabled, typing "C" in the AccountType field produces:
Auto expand

You may wish to bookmark this page so that you can easily refer back to the various forms properties.

mcknightfrid1937.blogspot.com

Source: https://holowczak.com/advanced-access-forms-design-access/3/

0 Response to "Vba Ms Access Setproperty Continuous Form Single Line"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel