An expression that selects records from the table.
Default = Record order. An expression that orders the records selected.
The name of the query. Use "Temporary Query" to define a query that Alpha Anywhere can discard to make room for new queries.
Default = "No". "Yes" = The query is in addition to the form's current query. "No" = The query replaces the form's currency query.
Default = "<Cross Level>". The name of the parent table when the Filter_Expression is based on the child table or the parent and child tables where there is a one-to-many relationship between the parent and child tables.
Default = .F. (FALSE). If no records are found, whether to display a warning.
Default = "". Refer to <TBL>.QUERY_CREATE()
The number of records found by the query.
Returns the number of records selected by the query in the current layout.
The <OBJECT>.QUERYRUN() method applies to:
- Browses (for <OBJECT> use either the <BROWSE> pointer or the name of the browse)
- Forms (for <OBJECT> use either the <FORM> pointer or the name of the form)
The <OBJECT>.QUERYRUN() method applies a query to the current layout. The method returns the number of records selected by the query.
The current script opens a form and only displays records from Massachusetts:
dim P as P P = form.load("customer information") Result = p.QueryRun("bill_state_region = 'ma'") if (result = 0) then ui_msg_box("Error","No records found") p.close() else p.activate() end if
To modify the above script to sort the result by lastname, change the .QUERYRUN() method to:
Result = p.QueryRun("bill_state_region = 'ma'", "lastname")
The following script applies a filter additively. The script is attached to a button on a form:
Old_filter = topparent.filter_get() Topparent.QueryRun("lastname = 'smith'", "", "", "Yes") 'To "undo" the last query: Topparent.QueryRun(old_filter)
Desktop applications only.