Solved Dont allow data to be manually typed (1 Viewer)

oxicottin

Learning by pecking away....
Local time
Yesterday, 22:09
Joined
Jun 26, 2007
Messages
856
Hello, I have a text box with an on click popup and employees are getting around the popup and manually entering data by tabbing to the textbox and not clicking in it to open the popup. How can I not allow then to manually type the data and force the on click?
 

pbaldy

Wino Moderator
Staff member
Local time
Yesterday, 19:09
Joined
Aug 30, 2003
Messages
36,125
Does locking the textbox work for you? The on focus event would catch both click and tab.
 

oxicottin

Learning by pecking away....
Local time
Yesterday, 22:09
Joined
Jun 26, 2007
Messages
856
That's brilliant, I never thought of that... Yes that worked perfectly!
 

Isaac

Lifelong Learner
Local time
Yesterday, 19:09
Joined
Mar 14, 2017
Messages
8,777
Yet another possibility, change to the Enter event rather than the Click event.

Frankly, I wouldn't try to use most Access form controls' Click event, generally speaking. Too much futzing about with what can or can't take the focus or receive a click.
 

oxicottin

Learning by pecking away....
Local time
Yesterday, 22:09
Joined
Jun 26, 2007
Messages
856
Ok ran into a pickle.... the on focus works great on opening my picker BUT once my picker moves the data from it back to the form im again able to enter anything and clicking in the textbox wont open the picker back up. The only way I can get the picker to open back up is to click on another text box and click back onto the one im wanting.

Thoughts?
 

pbaldy

Wino Moderator
Staff member
Local time
Yesterday, 19:09
Joined
Aug 30, 2003
Messages
36,125
Did you try locking the textbox? It would allow focus but prevent editing. As to the clicking, your code in the picker could move focus elsewhere.
 

oxicottin

Learning by pecking away....
Local time
Yesterday, 22:09
Joined
Jun 26, 2007
Messages
856
Yes I did... I attached an example of my two pickers and a few text boxes. Another example is if I chose not to select anything from either picker then it would allow manual data entry after the picker closed.
 

Attachments

  • GotFocusPicker_v1.accdb
    992 KB · Views: 87

oxicottin

Learning by pecking away....
Local time
Yesterday, 22:09
Joined
Jun 26, 2007
Messages
856
On a side note, do you know of any examples of a time picker that is the easiest to use other than sliders.
 

pbaldy

Wino Moderator
Staff member
Local time
Yesterday, 19:09
Joined
Aug 30, 2003
Messages
36,125
Does this as the last line in your get value function help?

Me.txtFirstTest.SetFocus

Are you saying you want the textbox unlocked if the user doesn't select from the picker? If so you could unlock it instead of setting its value.
 

pbaldy

Wino Moderator
Staff member
Local time
Yesterday, 19:09
Joined
Aug 30, 2003
Messages
36,125
I haven't used a time picker. I have apps where the user enters times, but they like "heads down" data entry so I just use an input mask where they enter a 4 digit number. They would shoot me if I popped up a picker like that. :p
 

oxicottin

Learning by pecking away....
Local time
Yesterday, 22:09
Joined
Jun 26, 2007
Messages
856
Im just saying I don't want the user manually entering data, at least for the length picker I could however just ditch that time one and let them enter it I hate it!
 

vhung

Member
Local time
Yesterday, 19:09
Joined
Jul 8, 2020
Messages
235
Ok ran into a pickle.... the on focus works great on opening my picker BUT once my picker moves the data from it back to the form im again able to enter anything and clicking in the textbox wont open the picker back up. The only way I can get the picker to open back up is to click on another text box and click back onto the one im wanting.

Thoughts?
good day

>supply your code to click Event "txtSampleTime"

Dim returnedValue As Variant

returnedValue = getValueFromPopUp("frm_TimePicker", "txtTime")
If returnedValue & "" <> "" Then Me.txtSampleTime = returnedValue

>result is all way pop-up

your TimeSlider is nice
>i'll make use of it
 

Attachments

  • TimeSlider.png
    TimeSlider.png
    66.9 KB · Views: 101
Last edited:

pbaldy

Wino Moderator
Staff member
Local time
Yesterday, 19:09
Joined
Aug 30, 2003
Messages
36,125
I'm not sure what you meant by this then:

Another example is if I chose not to select anything from either picker then it would allow manual data entry after the picker closed.
 

oxicottin

Learning by pecking away....
Local time
Yesterday, 22:09
Joined
Jun 26, 2007
Messages
856
I got it pbaldy it went to the text box but I was assuming it would allow data entry but it doesn't. I also ditched the time picker and set the format to h:nn and input mask to 00:00 .
 

pbaldy

Wino Moderator
Staff member
Local time
Yesterday, 19:09
Joined
Aug 30, 2003
Messages
36,125
Glad you got it sorted out!
 

Users who are viewing this thread

Top Bottom