I have programmed several command buttons (0-9) on my form in order to input numbers into a textbox. I have placed a mask of six characters and activated the auto tab feature in the textbox properties dialog. When I input 6 characters from the keyboard the auto tab works. When I input 6 characters from the command buttons the auto tab does not work. I read in help that Access ignores input masks when characters are not typed directly into the control. Is there a work-around for such a situation?
Access input masks and auto tab
Collapse
X
-
Tags: None
-
First let me make clear that I am a beginner in Access. I see the auto tab on the "Other" tab of the properties dialog with a yes/no response available. I do not see auto tab on the "Events" tab of the properties dialog where I could write code. Could you kindly provide more information on how and where this could be written, and if possible, an example.Comment
-
Ok, so let me know if the codes you are putting in for the command buttons isn't VBA (The place where you write code for events in event tab).
After the line of code where you add the character to the textbox, use the Len function to check the length of the characters in the textbox is 6. If its equals to 6, then use .SetFocus to the item you wished to select on, or use it to warn user not to continue the inputs. So the code would be like this:
Code:Private Sub Command1_Click() '************ 'The codes where you append a character to the text box '************ If Len(<name of your textbox>.Value) >= 6 Then 'If you are going to points to something else <name of your next item>.SetFocus End If End SubComment
-
colintis,
Your instruction and example proved very helpful. I've got the result I was looking for. Thanks so much!Comment
Comment