Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

Methods on a Form Data Source

Each form data source on a form has a set of standard methods. Override these methods to alter the behavior for validation, caching, and so on.

Access the standard methods.

  1. Expand the node for the form data source on the form.

  2. Right-click the Methods node.

  3. Select Override Method.

These methods are a subset of those on the FormDataSource system class.

The following table lists the methods that are available for form data sources and explains when they are executed. For more information on each method, click the method name.

NoteNote

Code written on forms cannot be re-used or inherited. If possible, write your code on the underlying table or in a class.


Method name

Executed when

Description

active

The user selects a new record.

Retrieves data from joined data sources when a user navigates to a new record.

create

The user creates a new record in the data source.

Creates a new record in the data source.

defaultMark

The user clicks the mark area (uppermost left corner) in a grid control.

Sets the default mark value for records in a form.

delete

The user deletes a record in the data source.

Deletes the current record from the data source.

deleteMarked

The user deletes one or more marked (selected) records in the data source.

Deletes all marked (selected) records from a data source.

displayOption

Activated before a record is displayed.

Sets the text color and the background color for a record in the data source.

executeQuery

The form is opened for data display.

Executes the data source query and displays the retrieved records.

filter

The user activates one of the Filter commands on the form shortcut menu.

Filters records in the data source.

findRecord

Activated by the findValue method.

Finds the specified record in the data source and makes it the current one.

findValue

The user clicks the Filter by Field command in the shortcut menu on a form control.

Finds the specified value in the data source and makes the record that has the specified value the current one by using the FormDataSource.findRecord method.

first

Focus moves to the first record in the data source.

Moves focus to the first record in the data source.

forceWrite

Executed when called.

Enables you to force a write operation on a record.

init

The form is opened.

Creates a data source query based on the data source properties.

initValue

A new record is created. The purpose is to fill in initial values in the record.

Initializes field values in a new record.

last

Focus moves to the last record in the data source.

Moves focus to the last record in the data source.

leave

Focus moves to a new record or to a new data source.

Provides notification when focus is moved to the next record or moved to another data source.

leaveRecord

Focus moves to a new record.

Provides notification when focus moves to another record or another item on the form.

linkActive

The user selects a new record in a form that has a data source linked to another data source.

Calls the FormDataSource.exeuteQuery method on data sources that are linked to the current data source.

markChanged

One or more records in the data source are marked or unmarked.

Enables you to perform an action when there is a change to the number of marked records in the data source.

next

Focus moves to the next record in the data source.

Moves focus to the next record in the data source.

prev

Focus moves to the previous record in the data source.

Moves focus to the previous record in the data source.

print

The user activates the Print command in the File menu.

Prints the current record.

prompt

The user activates the Advanced Filter/Sort command (either from the Edit > Filter menu or by pressing CTRL+F3).

Activates SysQueryForm, which is the standard form used to limit a query range.

refresh

Not activated by the system.

Updates the form by refreshing the view of all records in the data source.

refreshEx

A form is activated where records have been selected.

Refreshes the view of the specified records.

removeFilter

The user clicks the Remove Filter/Sort command in the shortcut menu on a form control.

Resets the query for the data source.

reread

Not activated by the system.

Rereads the current record from the database.

research

Not activated by the system.

Refreshes the database search defined by the query, specified by the FormDataSource.init method.

validateDelete

The user has chosen to delete a record.

Requests the user to confirm the deletion of a record from the data source.

validateWrite

A new or updated record is to be written.

Determines whether data is valid and ready to be written.

write

The user inserts a new record or updates an existing one.

Calls the FormDataSource.validateWrite method and manages the database write operation.

Community Additions

ADD
Show:
© 2015 Microsoft