Frequently asked questions - Base

From The Document Foundation Wiki
< Faq‎ | Base
Jump to: navigation, search

How to trigger a dialogue box when opening a query

The objective is to create a query with one or more parameterised variables. LibreOffice asks you to enter the values for these parameters with a dialogue box as soon as the query is executed.

To trigger the dialogue box when the query is run, you must insert a particular criterion in the columns of the fields concerned.

  • Either ?
  • Or a criterion in the form :Parameter_Name

Parameter value entry dialogue

  • By default the query uses the entered value for an exact search. To effect a partial match search, use the form "LIKE  :parameter_name"

Notes

  • Parameter names cannot include spaces
  • Parameters must not be enclosed in square brackets ( [ and ] )
  • The underscore character may be used

When the dialogue box opens :

  • for an exact match search, type the word (Base automatically adds single quotes)
  • for a partial match search, use the keyword LIKE and then enclose your entry between percent signs ("%")
  • to allow the search to match the entered string in either upper or lower case (ie case insensitive), the field definition must have type definition "VARCHAR_IGNORECASE"

A 'form' created with this request, with the wizard, will allow the dialogue box to open and then perform the query to select and display records.

In the same way, a report created in draft mode, with the wizard, will allow the dialogue box to open and then perform the query to select and display records.