473,397 Members | 1,961 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

Textbox Calendar Limiting

I have a textbox that i use as a calendar option. The text box populates the calendar option on the right. When clicked a Calendar picker type option appears. I'd like to be able to limit to only allow the user to pick current day to days before. Hope this makes sense.
Jun 30 '16 #1
2 848
TheSmileyCoder
2,322 Expert Mod 2GB
You can't limit the datepicker to prevent a user from CHOOSING a date in the future, but you CAN prevent the user from SAVING it.

In the CONTROLS Before_Update event you can do:
Expand|Select|Wrap|Line Numbers
  1. Private Sub DateControl_BeforeUpdate(Cancel as Integer)
  2.   If Isnull(me.DateControl) then exit sub 'This allows the user to blank out the control
  3.   if Me.DateControl>Date() then
  4.      Cancel=True 'This stops the user from saving
  5.      msgbox "The date entered lies in the future, please correct"
  6.   End If
  7. End Sub
Jul 1 '16 #2
Thank you! That was exactly what i needed.
Jul 19 '16 #3

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

Similar topics

3
by: JingleBEV | last post by:
Hi all, I have a masked text control that would return a date in string format via the mask property like: "9/23/2004" and i have a calendar control that would pop up when I click a command...
1
by: David Lozzi | last post by:
Hi, Thanks for your help. I'm using the calendar control for the first time. I'm squaring away the formatting and everything, but I have an interesting scenario, not sure if its possible: I'd...
4
by: wrytat | last post by:
I have a form with a textbox for the user to enter a quantity and another textbox for the delivery date. I disabled this delivery date textbox such that the user has to press a calendar link next...
4
by: Samy | last post by:
Hi There, I have a user control with a textbox and a button which when clicked opens a calendar control(calendar.aspx page). When I select a date from the calendar control, the date is supposed to...
0
by: Wyatt70 | last post by:
I'm attempting to implement a javascript popup calendar in a DataGrid. The calendar will be used to insert a date into a textbox. I keep getting a "System.NullReferenceException: Object reference...
3
by: brianwolters | last post by:
Hello, I have a calendar and a textbox right below it on my webpage. I need help with creating some code to display information about the date the user clicked in the text box below it. For...
3
by: thorpk | last post by:
I posted this problem earlier in the month and some one decided it was better to change the subject and ask a completely different question. I am therefore reposting. I am hoping some one can...
3
by: =?Utf-8?B?UGF1bA==?= | last post by:
Hi I am using an ajax masked edit extender along with a text box and masked edit validator and calendarExtender. It was working correctly but now for some reason when the user selects the image...
7
Frinavale
by: Frinavale | last post by:
I'm not sure how to even describe the problem but here I go. You know how you can display a date field in such a way that there is a calendar control that is "attached" to a text box that lets an...
2
by: joss Perold | last post by:
Hi I have a a gridview with a number of columns, each column has a textbox with a calendar extender attached. The problem comes when i click on the popup button, it opens a calendar for each row...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
Oralloy
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,...
0
tracyyun
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.