By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,659 Members | 1,717 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,659 IT Pros & Developers. It's quick & easy.

Access webDB form- Prevent user from directly typing into datepicker box

George Tekos
P: 47
hello! I have an Access 2010 webDB form that contains a date picker. (Users choose the date, fillup two more fields and submit the form)
I would like the user to choose the date from the calendar popup small window, not typing directly in the box. Can you help me?

if you want i can upload the db

Thank you
Dec 21 '11 #1

✓ answered by NeoPa

That falls under the single control category then. All that is available to you is what is made available by the designer of the control. In this case that's MS, but that's not important.

Share this Question
Share on Google+
13 Replies


NeoPa
Expert Mod 15k+
P: 31,712
I don't know what a webDB form is, but if the control you want to protect from user typing is set to Locked, then there will be no user typing into that control. Your code for populating it from the Calendar control could be written to set Locked to false prior to the update and then set it back again when it's finished. Does that make sense?
Dec 21 '11 #2

George Tekos
P: 47
if i set the control to "LOCKED", I cant type ofcourse, but neither choosing from the calendar. i wanted to know if there is a way of not typing, just choosing. access web dbs have less than the half regular features, enables... :(
Dec 21 '11 #3

NeoPa
Expert Mod 15k+
P: 31,712
I don't know as I don't have any experience with web dbs at all, but would the Calendar control not have an AfterUpdate event triggered when it's been used. Surely the code in there could clear then set the Locked property? I'm flying in the dark, but I expect there is a way of handling it if you look at what's available and how they interact.
Dec 21 '11 #4

100+
P: 759
No, NeoPa.
I think that George refer to a small calendar control near a text box control bound to a field with DATE type.
This small calendar do not exist in 2003. I know that exist in 2007 and, of course, must exist in 2010 because is very useful.

I have no idea, George how to prevent user to type into. But you can use BeforeUpdate event for that text box to check if what is entered is really a date. If not, cancel the Update event and prompt the user to use the calendar.

It is just an idea.
Dec 22 '11 #5

NeoPa
Expert Mod 15k+
P: 31,712
I wasn't sure whether it was a single control or two. The way you explain it, it seems to be both, so I'm still not clear. If they are separate controls then it seems there must be code running to reflect one in the other. Otherwise the control is designed that way and control design is something we can do very little about of course (We select a control to use and have to live with what is there).
Dec 22 '11 #6

100+
P: 759
Hi again, NeoPa.
I upload a small .jpg to show you the text box control with the Date Picker near it (a small square to the right).
This appear only when the control has focus. A click to the Date Picker open the small calendar (as you can see) from where the user can pick a date.

If the control is locked the Date Picker steel appear, the user steel can pick a date from calendar but with no results (no change in the text box / field).

Hope you understand that the Text Box + Date Picker is only one control.

Attached Images
File Type: jpg DatePicker.jpg (33.5 KB, 1728 views)
Dec 22 '11 #7

100+
P: 547
I would also like to prevent people from adding dates manually because when the datepicker is in use, the input mask function does not work.
Dec 22 '11 #8

NeoPa
Expert Mod 15k+
P: 31,712
I went to a copy of 2010 to see if I could check what you say. I found no Date Picker control available. Maybe the actual name would help.

Typically, if the TextBox control is updated by the Date Picker control then it isn't a TextBox control at all, but just something that looks in some way similar. A TextBox is a control, and not a part of a control. You may start to understand why I find your statements somewhat hard to take at face value. I can't see how they can possibly both be true. With the proper name of the control though, I might be able to find the truth for myself.
Dec 22 '11 #9

100+
P: 759
It is a text box, NeoPa.
I upload another .jpg to see the property sheet.
As you can see a property is Show Date Picker.
With two options: Never and For dates

Attached Images
File Type: jpg PropertySheet.jpg (33.5 KB, 1933 views)
Dec 22 '11 #10

George Tekos
P: 47
if someone chooses to create/open an Access 2010 WEB database, there is no choise for date picker box..
the only way it to FIRST set a field in the table as DATE, and AFTER to create a form, ADD EXISTING FIELDS, and the date picker will appear to the form, at the position you placed it. Yes it acts as one control , (always talking about WEB databases, and only)and it seems these two imput methods(pick date & type date) work together or dont work at all....
but after my previously solved issue, in which Narender Sagar helped me so much, i still believe in a potential solution...
Dec 22 '11 #11

NeoPa
Expert Mod 15k+
P: 31,712
Ah. That starts to make sense. It's an updated TextBox that provides DatePicker functionality as an option. It seems 2007 wasn't such a waste of time after all. There actually were some (an) useful improvements :-D
Dec 22 '11 #12

George Tekos
P: 47
Please pay attention to the title >>>Access webDB form-
i am not working on a regular access db.
Access 2010 Web databases have less than the half features enabled or "easily found" [ ]
Dec 22 '11 #13

NeoPa
Expert Mod 15k+
P: 31,712
That falls under the single control category then. All that is available to you is what is made available by the designer of the control. In this case that's MS, but that's not important.
Dec 22 '11 #14

Post your reply

Sign in to post your reply or Sign up for a free account.