输入面具? [英] Input Masks?

查看:83
本文介绍了输入面具?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,


我正在尝试一些东西,我不知道是否可能,甚至不知道如何去做。我有一个表格,上面有大约6个文本框。其中大多数用户正在输入。我有两个问题。用户输入孔号,另一个输入袋号(从该孔开始)。第一个包,我只需要知道如何从条目中删除空格。另一个有点困难。他们可以输入三种可能的条目类型。它们如下:LDD - ###,120 - ## - ###,和STW - ## - ###。我遇到的问题是我有人(大多数人几乎不知道如何运行comp)在空格,冒号和其他各种符号中输入文本框。有没有办法检查前三位数并确保它们正确输入?我希望这对我想做的事情有意义。


Andrew

Hello,

I am trying something and i don''t know if it is possible or even how to go about doing it. I have a form with about 6 text boxes on it. most of these, the users are entering ok. I am having problems with two. The user is to enter the Hole number and the other os to enter the bag number (from that hole). The bag number one, i just need to know how to remove spaces from their entries. The other is a little more difficult. There are three possible entry types that they can enter. They are as follows: LDD-###, 120-##-###, and STW-##-###. The problem I am having is I have people (mostly people who barely know how to run a comp) entering in spaces, colons and other various symbols into the text box. Is there a way to check the first three digits and make sure they are entering them in correctly? i hope this makes sense what i am trying to do.

Andrew

推荐答案

有很多有用的解释帮助文件中的输入掩码属性,所以我会在这里为你引用它。这涵盖了您所询问的所有主题,但如果您仍然遇到问题,请再回来查看。这是一个很少有人熟悉的领域,但是相当强大。

关注如何进入该领域,有些情况下用户在进入现场时会感到困惑并找到他们自己在右手而不是左手边。如果你处理这个问题,你应该能够使它变得更好并且能够防止操作。祝好运。
There is quite a bit of helpful explanation of the Input Mask property in the help file so I''ll quote it here for you. This covers all the topics you''ve asked about, but if you still have problems please come back for more. It''s an area that few people are familiar with, but quite powerful nevertheless.
Careful with how the field is entered though, there are situations where users get confused as they go to the field and find themselves at the RIGHT hand end rather than at the left. If you handle this though, you should be able to make it nice and operator-proof. Good luck.

InputMask属性

请参阅应用ToExampleSpecifics您可以使用InputMask属性更轻松地输入数据并控制用户可以在文本中输入的值盒子控制。读/写字符串。


expression.InputMask

表达式必需。返回应用于列表中的一个对象的表达式。

备注

输入掩码有助于数据输入操作,例如输入掩码电话号码字段,显示如何输入新号码:(___)___-____。使用输入掩码向导通常更容易为您设置属性。

InputMask属性最多可包含由分号(;)分隔的三个部分。


部分描述

First指定输入掩码本身;例如,!(999)999-9999。有关可用于定义输入掩码的字符列表,请参阅下表。

Second指定Microsoft Access在输入数据时是否在表中存储文字显示字符。如果对此部分使用0,则所有文字显示字符(例如,电话号码输入掩码中的括号)都将与值一起存储;如果输入1或将此部分留空,则仅存储键入控件的字符。

Third指定Microsoft Access为应在输入掩码中键入字符的空间显示的字符。对于本节,您可以使用任何字符;要显示空字符串,请使用括在引号(")中的空格。


在Visual Basic中,您使用字符串表达式来设置此属性。例如,以下内容指定用于输入电话号码的文本框控件的输入掩码:


Forms!Customers!Telephone.InputMask ="(###)## # - ####"


创建输入掩码时,可以使用特殊字符要求输入某些数据(例如,电话号码的区号)并且其他数据是可选的(例如电话分机)。这些字符指定您必须为输入掩码中的每个字符输入的数据类型,例如数字或字符。


您可以使用以下字符定义输入掩码。


字符描述

0数字(0到9,需要输入,加上[+]和减去[?]符号不允许)。

9数字或空格(不需要输入,不允许加号和减号)。

#数字或空格(不需要输入;空格在编辑模式下显示为空格,但保存数据时删除空格;允许加号和减号)。

L Letter(A到Z,需要输入)。

?信(A到Z,条目可选)。

一个字母或数字(需要输入)。

一个字母或数字(条目可选)。

&任何角色或空间(需要输入)。

C任何字符或空格(条目可选)。

。 ,:; - /十进制占位符和千位,日期和时间分隔符。 (使用的实际字符取决于Windows控制面板中区域设置属性对话框中的设置)。

<导致所有字符都转换为小写。

>导致所有字符都转换为大写。

!使输入掩码从右向左显示,而不是从左向右显示。键入掩码的字符始终从左到右填充。您可以在输入掩码中的任何位置包含感叹号。

\使得后面的字符显示为文字字符(例如,\A显示为A)。


注意将InputMask属性设置为单词Password。创建密码输入控件。控件中键入的任何字符都存储为字符,但显示为星号(*)。您使用密码输入掩码来防止在屏幕上显示键入的字符。


对于控件,您可以在控件的属性表中设置此属性。对于表中的字段,可以在表设计视图(在字段属性部分中)或查询窗口的设计视图中(在字段属性属性表中)设置该属性。


您还可以使用宏或Visual Basic设置InputMask属性。

当您在已定义输入掩码的字段中键入数据时,数据为始终进入Overtype模式。如果使用BACKSPACE键删除字符,则该字符将替换为空格。


如果从已定义输入掩码的字段移动文本即使您已指定不使用数据保存剪贴板,也会复制文字显示字符。


注意只能直接在控件中键入的字符或组合框受输入掩码的影响。通过在Visual Basic中设置控件的Text属性或在宏中使用SetValue操作,Microsoft Access在导入数据,运行操作查询或在控件中输入字符时忽略任何输入掩码。



当您定义了输入掩码并为同一字段设置了Format属性时,Format属性在显示数据时优先。这意味着即使您保存了输入掩码,在格式化和显示数据时也会忽略输入掩码。基础表中的数据本身没有改变; Format属性仅影响数据的显示方式。
InputMask Property
See AlsoApplies ToExampleSpecificsYou can use the InputMask property to make data entry easier and to control the values users can enter in a text box control. Read/write String.

expression.InputMask
expression Required. An expression that returns one of the objects in the Applies To list.

Remarks
Input masks are helpful for data-entry operations such as an input mask for a Phone Number field that shows you exactly how to enter a new number: (___) ___-____. It is often easier to use the Input Mask Wizard to set the property for you.

The InputMask property can contain up to three sections separated by semicolons (;).

Section Description
First Specifies the input mask itself; for example, !(999) 999-9999. For a list of characters you can use to define the input mask, see the following table.
Second Specifies whether Microsoft Access stores the literal display characters in the table when you enter data. If you use 0 for this section, all literal display characters (for example, the parentheses in a phone number input mask) are stored with the value; if you enter 1 or leave this section blank, only characters typed into the control are stored.
Third Specifies the character that Microsoft Access displays for the space where you should type a character in the input mask. For this section, you can use any character; to display an empty string, use a space enclosed in quotation marks (" ").


In Visual Basic you use a string expression to set this property. For example, the following specifies an input mask for a text box control used for entering a phone number:

Forms!Customers!Telephone.InputMask = "(###) ###-####"

When you create an input mask, you can use special characters to require that certain data be entered (for example, the area code for a phone number) and that other data be optional (such as a telephone extension). These characters specify the type of data, such as a number or character, that you must enter for each character in the input mask.

You can define an input mask by using the following characters.

Character Description
0 Digit (0 to 9, entry required, plus [+] and minus [?] signs not allowed).
9 Digit or space (entry not required, plus and minus signs not allowed).
# Digit or space (entry not required; spaces are displayed as blanks while in Edit mode, but blanks are removed when data is saved; plus and minus signs allowed).
L Letter (A to Z, entry required).
? Letter (A to Z, entry optional).
A Letter or digit (entry required).
a Letter or digit (entry optional).
& Any character or a space (entry required).
C Any character or a space (entry optional).
. , : ; - / Decimal placeholder and thousand, date, and time separators. (The actual character used depends on the settings in the Regional Settings Properties dialog box in Windows Control Panel).
< Causes all characters to be converted to lowercase.
> Causes all characters to be converted to uppercase.
! Causes the input mask to display from right to left, rather than from left to right. Characters typed into the mask always fill it from left to right. You can include the exclamation point anywhere in the input mask.
\ Causes the character that follows to be displayed as the literal character (for example, \A is displayed as just A).

Note Setting the InputMask property to the word "Password" creates a password-entry control. Any character typed in the control is stored as the character but is displayed as an asterisk (*). You use the Password input mask to prevent displaying the typed characters on the screen.

For a control, you can set this property in the control''s property sheet. For a field in a table, you can set the property in table Design view (in the Field Properties section) or in Design view of the Query window (in the Field Properties property sheet ).

You can also set the InputMask property by using a macro or Visual Basic.

When you type data in a field for which you''ve defined an input mask, the data is always entered in Overtype mode. If you use the BACKSPACE key to delete a character, the character is replaced by a blank space.

If you move text from a field for which you''ve defined an input mask onto the Clipboard, the literal display characters are copied, even if you have specified that they not be saved with data.


Note Only characters that you type directly in a control or combo box are affected by the input mask. Microsoft Access ignores any input masks when you import data, run an action query, or enter characters in a control by setting the control''s Text property in Visual Basic or by using the SetValue action in a macro.


When you''ve defined an input mask and set the Format property for the same field, the Format property takes precedence when the data is displayed. This means that even if you''ve saved an input mask, the input mask is ignored when data is formatted and displayed. The data in the underlying table itself isn''t changed; the Format property affects only how the data is displayed.



你好,


我正在尝试的东西和我不知道是否可能,甚至不知道如何去做。我有一个表格,上面有大约6个文本框。其中大多数用户正在输入。我有两个问题。用户输入孔号,另一个输入袋号(从该孔开始)。第一个包,我只需要知道如何从条目中删除空格。另一个有点困难。他们可以输入三种可能的条目类型。它们如下:LDD - ###,120 - ## - ###,和STW - ## - ###。我遇到的问题是我有人(大多数人几乎不知道如何运行comp)在空格,冒号和其他各种符号中输入文本框。有没有办法检查前三位数并确保它们正确输入?我希望这对我想做的事情有意义。


安德鲁
Hello,

I am trying something and i don''t know if it is possible or even how to go about doing it. I have a form with about 6 text boxes on it. most of these, the users are entering ok. I am having problems with two. The user is to enter the Hole number and the other os to enter the bag number (from that hole). The bag number one, i just need to know how to remove spaces from their entries. The other is a little more difficult. There are three possible entry types that they can enter. They are as follows: LDD-###, 120-##-###, and STW-##-###. The problem I am having is I have people (mostly people who barely know how to run a comp) entering in spaces, colons and other various symbols into the text box. Is there a way to check the first three digits and make sure they are entering them in correctly? i hope this makes sense what i am trying to do.

Andrew



我想知道或者数字那个输入的可能是产品代码。

如果是这样,那么它们应该是已知的。然后可以选择使用组合框进行选择。

你的第六个文本框是分开的。分成两个或三个部分。当LDD-,120-和STW-固定时,您可以让用户从组合框(或通过无线电按钮框架)中选择它们,并根据选择提供###或## - ###字段。


只是一些想法,关于代码的内容和原因的更多信息可以帮助...


Nic; o)

I would like to know or the numbers that are entered are perhaps Productcodes.
If so, then they should be "known" and then it''s an option to use a combobox for the selection.
Your sixth textbox is "divided" into two or three "sections". When the LDD-, 120- and STW- are fixed, then you could have the user to select them from a combobox (or by a radiobutton frame) and based on the choice offer the ### or the ##-### field.

Just some thoughts, more information about the what and why of the codes could help...

Nic;o)


此数据库用于矿井,代码用于钻孔。它们适用于现场的不同区域。例如。 STW-07-007如下:STW代表区域,07代表年份,007代表孔数。 120-07-007如下:120是区域,07是年份,007是孔号。 LDD-060如下:LDD用于大直径钻孔,060是孔(LDD孔位于本地矿区,因此没有实际的区域代码)。我将更多地查看输入掩码,看看我能做些什么来使用它们。我看到我可以输入最多3个不同的输入掩码,所以这可能是我的答案。但是,非常感谢您的帮助。


Andrew
This db is for a mine and the codes are for drill holes. They are for different areas on site. eg. STW-07-007 is as follows: STW stands for the area, 07 is the year, and 007 is the hole number. 120-07-007 is as follows: 120 is the area, 07 is the year, and 007 is the hole number. LDD-060 is as follows:LDD is for Large Diameter Drills and 060 is the hole (the LDD holes are in the local mine site area so there is no actual area code). I will look up more on input masks and see what i can do to use them. I see I can enter up to 3 different input masks so this may be my answer. But any more help you can be is greatly appreciated

Andrew


这篇关于输入面具?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆