473,396 Members | 2,089 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,396 software developers and data experts.

Disable by date

9
I would like, for example, to make a control invisible after a certain date.

I tried in the onload event of the form the following:
if date > #10/10/07# then
controlname.visible=false
end if

This did not work. However, I did get some erratic results when trying different formats.

I appreciate anyone pointing me in the right direction.
Oct 28 '07 #1
4 1177
MMcCarthy
14,534 Expert Mod 8TB
Try this ...

Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Load()
  2.  
  3.     If Now() > #10/10/2007# Then
  4.       Me!Command0.Visible = False
  5.     End If
  6.  
  7. End Sub
  8.  
Oct 28 '07 #2
NeoPa
32,556 Expert Mod 16PB
Or, if you just want after the date rather than on it too :
Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Load()
  2.   Me.Command0.Visible = (Date() <= #10/10/2007#)
  3. End Sub
NB. The order of the date literal (#10/10/2007#) MUST be m/d/yyyy, regardless of your national settings. This is standard SQL Date format (Literal DateTimes and Their Delimiters (#).).
Oct 28 '07 #3
guroos
9
Thank you very much, works great.
Oct 28 '07 #4
NeoPa
32,556 Expert Mod 16PB
No problems. We're glad it worked for you :)
Oct 29 '07 #5

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

Similar topics

1
by: hortoristic | last post by:
We are using JavaScript to Enable/Disable certain fields on web pages based on business rules. A simple example is if when using an option type tag, and the two options are Yes and No. If YES...
1
by: Matthew | last post by:
I have a form with fields that act as user specified criteria for a form. Two of the fields are start and finish date. The fields in my query are "ID", "TimeStart", "TimeEnd", etc. Currently, I...
2
by: Will | last post by:
I have a form which has a field Start Date. I want to only let the user enter a date if there is no date in the field and never be able to edit the field. I have experimented with On Enter and On...
2
by: techfuzz | last post by:
I scoured this group and others looking for the best way to disable a button after the first click to prevent multiple submissions, but never did find anything that worked like they said it would. ...
16
by: MLH | last post by:
If I give someone a runtime app, they can open the database window by pressing the F-11 key. How to prevent???
0
by: Kumar R | last post by:
How to disable the specific date in the DateTimePicker control. suppose i want to disable all sundays and saturdays of the particular month. how to do? i search in the many sites, but i didn't find...
7
by: tommaso.gastaldi | last post by:
It would be useful, sometimes, when debugging, to disable all the try /catch one has in the program (clearly not commenting them out). Any info or hint on that? -tom
3
by: James | last post by:
Hello, I am having a problem with a MS Access 2000 Database that I partially helped create. I am recording visits that registered customers make to our store. I have a list of all the elidgible...
3
by: KMEscherich | last post by:
Hi there, I have a Save REQUIRED fields button and when all required fields have been filled in, the Save REQUIRED fields button becomes enabled. I have created a DATE field so that when the button...
4
by: =?Utf-8?B?TUNN?= | last post by:
I am trying to disable ViewState at the application level. I have the following line in my web.config: <pages enableViewState="false"></pages> But it is not working. What can I do?
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
marktang
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,...
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...

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.