Access beginner,
Hi,
Im using code to unlock information so the user can change the information. I also need the input mask to change from "password" to "text", but im struggling with that specific part of the code.
Thanks
Theuns
Private Sub EmployeeCode_En ter()
Dim strInput As String, strMsg As String
strMsg = "'Action code'is password protected."
strInput = InputBox(prompt :=strMsg, _
Title:="Emplyee 'action code'")
If strInput = "CLR" Then
Me.EmployeeCode .Locked = False
'Me.EmployeeCod e.InputMask = text
'InputMask = password
Else
Me.EmployeeCode .Locked = True
End If
5 16938
The question that has to be asked is "Why?" If you feel it's important enough to require an input mask in one instance, why would you change that in another instance? At any rate, the simple fact is that you can't! Input masks can only be defined in Design View.
Also, when using most Input Masks (it doesn't really matter for Password) be sure in use code like this to assure that if the user clicks on the textbox the cursor will go to the beginning of the field. Otherwise the insert point will be wherever they clicked in, and they'll waste time redoing it! - Private Sub YourTextBoxName_Click()
-
Me.YourTextBoxName.SelStart = 0
-
End Sub
-
If your Access default for Entering a Field is set to anything other than "Go to start of field," also use this - Private Sub YourTextBoxName_GotFocus()
-
Me.YourTextBoxName.SelStart = 0
-
End Sub
Welcome to TheScripts!
Linq ;0)> ADezii 8,834
Recognized Expert Expert
Access beginner,
Hi,
Im using code to unlock information so the user can change the information. I also need the input mask to change from "password" to "text", but im struggling with that specific part of the code.
Thanks
Theuns
Private Sub EmployeeCode_En ter()
Dim strInput As String, strMsg As String
strMsg = "'Action code'is password protected."
strInput = InputBox(prompt :=strMsg, _
Title:="Emplyee 'action code'")
If strInput = "CLR" Then
Me.EmployeeCode .Locked = False
'Me.EmployeeCod e.InputMask = text
'InputMask = password
Else
Me.EmployeeCode .Locked = True
End If
You can programmaticall y change the Input Mask for a Control, but as indicated by missingling, why? If you insist, the logic wouold be something similar to: - Private Sub txtTest_GotFocus()
-
If <some condition> = True Then
-
Me![txtTest].InputMask = "Password"
-
Else
-
Me![txtTest].InputMask = "000-00-0000"
-
End If
-
End Sub
Didn't realize that, ADezii! Access Help doesn't mention this; what a surprise!
Linq ;0)> ADezii 8,834
Recognized Expert Expert
Didn't realize that, ADezii! Access Help doesn't mention this; what a surprise!
Linq ;0)>
Like you stated earlier, it's something you wouldn't normally do with code, but there's always a first.
I know this is an ancient thread, but it points out something that novices and experts alike need to remember: don't ask WHY, just answer the question.
In this case, it is now more and more common to see a "show" checkbox (cell phones and desktops both) so you can see your password when no one is looking over your shoulder.
Here, the "beginner" is showing the "experts" something they could have used!
Tom the Toolman
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: dude |
last post by:
hello
how would i make an input mask that only makes the first letter a
capitol one?
i've been playing around and testing various masks, also tried the
wizard, but i've had no luck.
could anyone help, many thanks in advance.
|
by: Miranda Evans |
last post by:
In my application, a text box control resides in a form. The text box
control is unbound, but--assuming all edits are passed when the user
click a command button on the form--the contents of the text box
control end up in a field in a table with a data type of Date/Time.
Is it possible to set up a mask on this text box control such that if...
|
by: Paul |
last post by:
hi,
is there an input mask i could use on a report to do the following:
(1) if i enter "THISISATEST" on my form, i want
the text box on my report to display: "T H I S I S A T E S T".
(2) if i enter "THIS IS A TEST" on my form, i want
the text box on my report to display: "T H I S I S A T E S
T".
|
by: johnp |
last post by:
Hi,
Our Tech department updated users to Office 2003 this week. Now the
input mask in one of the applications is showing up as:
(###) ###-###
The input mask wizard works correctly when I redo the mask. But in
form view, the mask appears reverts to the previous.
|
by: F. Michael Miller |
last post by:
I have a db with Access front end, sql back, linked tables. I need to be
able to change input masks at the table level in code.
Any ideas?
Thanks!
| |
by: AA Arens |
last post by:
When I want the first character of a field to be Uppercased, I need to
make an input mask, like >L< followed by ??????? for example. But this
mask creates ____ in an unfilled field, which I don't like. How to get
the fist character uppercased without an input mask or without ____
(underscores).
When I click with the mouse on an empty field,...
|
by: msnews.microsoft.com |
last post by:
Hello.
How can I set input mask for TextBox?
Or can I use for mask input some other control?
|
by: JamesDC |
last post by:
Hi,
So I'm working with an Access 2002 database for waste managemnt. The person in my role before my put together the program before he left and now I'm in charge of it. After updating a few areas based on the requests of the employees using the database I have come accross a problem with how dates are stored.
I have a form for the...
|
by: desklamp |
last post by:
I'm a total Access newbie, please bear with me! Using Win2K/Access 2003.
I'm trying to create a table in which I can store IP addresses and other information. According to Microsoft, there is no native way of converting an IP address to an integer/long number (which is much more efficient to index and search). After searching, I found a...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it. ...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |