Validation of input values. Why is Access asking for a parameter value? Entered values

Description:

Using the function ENTER_VALUE during the execution of the calculation, you can request additional data necessary for the calculation. The value is entered in the dialog box.

This function allows you to enter values ​​of the following types:

line;

number;

date;

time;

logics;

a bunch of;

selection of an array element;

When entering a number, you can use the built-in calculator by pressing the key F2 or select button to the right of the field.

When entering a date, similarly, you can use the calendar by pressing the key F2 or select buttonto the right of the field and the transition to the next and previous day using the buttons.

When entering values ​​of the number type, you can specify a range of values, and for a string, the maximum width.

Syntax:

ENTER_VALUE (<запрос> [, <исходное значение> [, <макс ширина>or<мин> [, <макс> ] ] ] [ : <доп опции> ])

where

<запрос>
a string containing the question;

<исходное значение>
the value that will be offered by default;

<макс. ширина>
the value of the field width for entering a string;

<мин>, <макс>
respectively, the minimum and maximum value to enter a number. If only one parameter is specified, then it is considered the maximum, and the minimum value is zero.

<доп опции>
for a number - the number of digits after the decimal point, if the parameter is not specified, a number with any number of digits can be entered;
for date and time - the ability to enter an empty date and an empty time;

The function allows you to set the initial value for the input field. The input value type is determined by the initial value specified in the function parameters. If no initial value is given, a string request is assumed. The initial value can be given as:

string (for example, ENTER_VALUE ( "Enter purpose of payment", "Payment for " ));

number (for example, ENTER_VALUE ( "Enter tax rate", 20));

date (for example, ENTER_VALUE ( "Enter Start Date", 01.01.2010));

time (for example, ENTER_VALUE ( "What time did the car arrive", TIME_CURRENT ));

logic (ex. ENTER_VALUE ("Do convolution" , YES ));

many (for example, ENTER_VALUE ("VAT" , VATPlus ));

array (eg. ENTER_VALUE ( "Choose an option", [ "Option1" , "Option2" , "Option3" ])).

In the case of an array, the number of the original value is entered with a comma after the listed options.

The result is an input value whose type corresponds to the type of the original value specified in the function parameters. In the case of an array, the result is the number of the selected option.

Example 1:

Below is an example where using the function ENTER_VALUE the record number in the database is entered, and then the transition to this record is performed. When the function is executed, a dialog box will appear on the screen containing a column for entering the record number:

By default, the graph will be set to the value specified by the second argument of the function (in this case one). The third and fourth parameters limit the minimum and maximum record number, respectively (in this case, 1 and DB_TOTAL ). To variable number the value entered in the dialog box will be written.

number = ENTER_VALUE ( "Enter column number: ", 1, 1, columns. TOTAL )

columns. GO (number)

Example 2:

Below is an example where using the function ENTER_VALUE you are prompted to choose one of the options. When the function is executed, a dialog box will appear on the screen, which will list the options specified by the second parameter of the function:

To the left of each option is a radio button. To select an option, click the radio button in front of the desired item, and then press the or click on the button .

The item selected by default is the one specified by the third parameter of the function.

period_id = ENTER_VALUE ( "Select period",[ "Day" , "Five Days" , "Week" ,

"Decade" , "Month" , "Quarter" , "Year" ])

A set of options can also be specified using a variable:

select!1 = "Day"

select!2 = "Five Days"

select!3 = "Week"

select!5 = "Month"

select!6 = "Quarter"

select!7 = "Year"

period_id = ENTER_VALUE ( "Select period",choice)

date_start = PERIOD_START (DATE_START, period_id)

date_end \u003d PERIOD_CON (DATE_CON, period_id)

Forms and reports can use the functionENTER_VALUE!, which does not display an input dialog. Instead, in context menu form or report parameters dialog containing this function, an option appears that determines the result returned by the function.

Syntax:

ENTER_VALUE! (<запрос> , <тип>or<множество>or <список значений> )

where

<запрос>
a string constant containing the question;

<тип>
input type maybe STRING, NUMBER, LOGIC, DATE, TIME;

<множество>
set identifier;

<список значений>
list of values ​​in square brackets.

After exclamation point you can put.

Examples:

ENTER_VALUE!("Conclusion of the commission", LINE )

ENTER_VALUE!("Analysis" , [ "Full" , "Partial" ])

ENTER_VALUE!("Type of VAT accounting", ndsPlus)

Sometimes when you open an Access object (for example, a table, query, form, or report), a dialog box is displayed Enter parameter value. When you open an object that contains an identifier or expression that Access cannot interpret, the following dialog box appears.

In some cases, this is just what the user needs. For example, the database creator can set up a query that allows information to be entered each time it is run, such as a start date or employee code. Such a dialog box might look like this:

But in other cases, the appearance of this dialog box is undesirable. For example, you have made changes to the database structure, and now when you open an object in Access, you suddenly see a dialog box with an incomprehensible message.

This article describes how to set the reasons for requesting certain parameter values ​​in Access and how to stop such requests.

Note: This article does not apply to Access web apps - a type of database design with Access and publish to the web in Office 365 or SharePoint.

How to stop parameter value requests

To dialog box Enter parameter value does not appear anymore, you need to check all the expressions associated with the work object and find the identifier that calls this window. Then you need to correct the identifier or the syntax of the expression that contains this identifier.

For more information about expression syntax, see the links in the See Also section.

When an Unwanted Dialog Box Appears Enter parameter value note the identifier or expression displayed in the dialog box. For example "SomeIdentifier" as shown in the screenshot below.

Click the Cancel button and do one of the following procedures, depending on the type of object that opens the dialog box. The following are general instructions for checking expressions in various types objects. Note that the specific changes that need to be made depend on the structure of the database.

Checking expressions in a query

Typographical errors in queries are a common cause of unwanted dialog boxes. As mentioned earlier, if the query is intended to receive data about the value of a parameter at startup, a dialog box appears. Enter parameter value. But if the query is not supposed to ask for a parameter value, try to find invalid expressions in the query using the following procedure.


Checking expressions in a report

If a dialog box appears when opening a report Enter parameter value, follow these steps to check the report properties.


Validating expressions in a base form query

If the dialog box Enter parameter value appears each time the form is opened, the wrong expression may be in the underlying query. Check the underlying query for incorrect expressions.

Validate expressions in a box or combo box on a form

Incorrect expression in parameter String source a control such as a combo box or combo box can cause a dialog box to appear Enter parameter value. In some cases, the dialog box does not appear until you try to use the control. To check the parameter String source control, use the following procedure.

    In the Navigation Pane, right-click the form and select Constructor.

    Select the field or combo box you want to check.

    If the task area Property Page is not displayed, press the F4 key.

    Go to the tab Data, check the property String source and determine if the text matches the text in the dialog box Enter parameter value.

Checking expressions in a table

If Access displays a dialog box Enter parameter value every time you open the table, most likely the wrong expression is contained in the property String source lookup fields of this table.

    In the Navigation Pane, right-click the table and select Constructor.

    To determine if a field is a lookup field, click the name of the field, and then on the context menu Field Properties select tab Substitution. If the tab contains a property String source, the field is a lookup field. Explore Property String source. If it contains an SQL statement, then one of the identifiers in the expression may be incorrect, which causes the dialog box to appear Enter parameter value.

Note: A table can contain multiple lookup fields, so check the lookup tabs for each field.

 WORKSHOP:

In open file 04_1 Protection , set file opening protection by specifying password Excel2010 . Close file.

 Open file Protection, remove password.

Validation of input values

Data Validation is an Excel tool with which the user can create restrictions on data entry into cells, as well as display messages on the screen prompting you to perform the correct actions and notify you of errors.

With data validation, you can simplify the entry of repeated data by forming a drop-down list from them.

You can create a cell prompt that appears when the cell is selected. Thus, you can prompt the user about the need to enter certain data.

Setting Data Entry Restrictions

If the table is just to be filled in, then to avoid accidental typos or to make it easier to enter duplicate values, you can set restrictions on the input data.

If the table is already filled with data, then in order to detect incorrect data, you must also set limits on the data.

1. Select a range of cells.

2. On the Data tab, in the group Working with data, select

Data validation .

3. In the dialog boxValidation of input values on the Options tab,

ask Check condition– choose the data type and put a restriction on the input values.

 Any value - no restrictions on data entry.

 Integer – enter only whole numbers.

 Real - enter both integer and fractional numbers.

 Date - date input restriction.

 Time - Enter only the time.

 Text length -

limit on the number of characters entered.

Microsoft Excel 2010 Level 2 Advanced Features

 Another - the possibility of more extensive control over data entry is provided, the verification condition is set using a formula.

 List - enter data from the proposed list (there are no restrictions on the type of data). The maximum can contain 32767 elements. The list source can be:

 Enter from the keyboard, separating with a semicolon; (separator depends on

regional settings - can be a comma , ).

Select cells from any sheet of the current workbook.

select named range with key F3 .

By applying the check types Integer or Real , only a number can be entered into the cell. However, it is worth remembering that Excel perceives and stores dates and times exactly as numeric values, so entering a date and time will also be allowed if it does not contradict the rest of the verification conditions.

4. On the Message input tab

Enter a hint about data entry restrictions. The tooltip will be displayed in the active cell, provided that the option Show is selected

hint if cell is current .

5. On the Error Message tab

In the View field, select:

 Stop - prohibition of entering incorrect data, an error message appears.

 Warning - incorrect data entry is allowed, if confirmed by the user - Yes

 Message - Invalid data entry is allowed when the user confirms -OK .

An error message will be displayed on the screen, provided that the Display

error message.

When entering incorrect data in a cell, an input message (hint) and a warning were displayed:

Microsoft Excel 2010 Level 2 Advanced Features

Finding invalid data

If the data in the table is already filled in, and it is necessary to detect incorrectly entered values, you must first set restrictions on the entered data, and then ask the program to circle all incorrect data.

To do this, on the tab Data in the group Working with data, open the list of the Data Validation button and select Circle incorrect data in the Data Tools group , open button list Data validation and choose Remove the stroke of the incorrect data and with a quick, precise movement introduced the needle. Kron, House and ship. || To be included in someone or something. [Famusov:] He warmed the bezrodny and brought him into my family, Gave him the rank of assessor and took him as a secretary. Griboyedov, Woe from Wit. [Vyshnevskaya:] In the empty, petty circle of his acquaintances, into which he introduced me, all the best spiritual qualities have died out in me. A. Ostrovsky, Profitable place. Lelyukov explained why army infantrymen were introduced into our squad. Perventsev, Honor from a young age. || Pour, let in, bring, etc. into smth. It is possible to prepare artificial soil from sand --- and, having introduced the necessary nutrients into it, to obtain a completely fertile soil, Timiryazev, Plant life. - Imagine, for a month of swimming on this beach, the body absorbs more iodine than during this time you can artificially introduce it inside. A. N. Tolstoy, Sisters.

2. (with a pretext"on the"). Leading, help climb somewhere, lead upstairs. Enter the stairs.

3. To involve in smth., to lead into smth. condition. Add to expense.The Petersburg cut of the frock coat misled them, but, soon recognizing army epaulettes, they turned away indignantly. Lermontov, Princess Mary.

4. Install, establish. Introduce universal compulsory education. Introduce duties on the import of goods.Konstantin Gorelkin introduced severe discipline in the detachment. B. Polevoy, Countryman. || Accept for consumption; implement. In Yuzovka, Kurako rebuilt two furnaces - introduced inclined bridges, American deep forges. Beck, Kurako. It was necessary to finally resolve the issue of tuyere devices ---. I said to Pastukhov: - You and I have already decided to introduce copper tuyeres. M. Pavlov, Memoirs of a Metallurgist.

5. (with a pretext"v"). Combined with nouns: action, exploitation, use, wont, everyday life, turnover etc. means: to make usable or active. Launch a new mine. Put the power plant into operation.

Take possession ( or in inheritance)- transfer ownership of real estate, inheritance, etc., approving the ownership rights by the relevant legal act. Enter into the course what- to introduce smth.

Get to the heart of the matter or question)- to acquaint with the main provisions (cases, questions).

Source (printed version): Dictionary of the Russian language: In 4 volumes / RAS, Institute of Linguistics. research; Ed. A. P. Evgenieva. - 4th ed., erased. - M.: Rus. lang.; Polygraphic resources, 1999; (electronic version):