Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - How to set an Access text box? You can only enter multiples of 0.5.
How to set an Access text box? You can only enter multiples of 0.5.
For the limitation of data, in simple terms, there are two methods that do not require programming:

One is to set a mask, which can be defined as text, plastic, date and so on. However, the topic here should be measured by 0.5, and masks cannot be realized.

The second is to set validity rules. First of all, understand the topic, a multiple of 0.5, which means that this number is an integer as long as it is multiplied by 2. In this way, you can go to a judgment condition and set the validity. For example, the form establishes a text box named text0, and writes the following in its properties → data → validity rules:

[Text0]*2-Int([Text0]*2)=0

Test, is it true that when you enter multiples other than 0.5, a dialog box will pop up saying that the input does not conform to the validity rules?

Of course, from the point of view of humanization, it is best to use programming method, add code after updating the text box, and judge with the above conditions. If there is a problem, use msgbox command to pop up a custom dialog box, so much the better.