Default Date format

gheyman

Well-known Member
Joined
Nov 14, 2005
Messages
2,347
Office Version
  1. 365
Platform
  1. Windows
I have an unbound textbox that is date formatted. I want the default date to be 01/01/2000. I tried entering "01/01/2000" into the Default Value in the properties. But I must be doing this incorrectly because in form view I get 30-Dec-1899 in the textbox.

Help! please


Never Mind - #01/01/2000#
 
Last edited:

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
Thanks! That helped a lot.
I am using the two date text boxes for a query. Is there a way to put a toggle button, or something similar next to it and have it override the date range so it shows All?

I defaulted the start date back to the year 2000 thinking that will pull everything since the data is not that old. The problem with this is that when the user goes to change the start date of the range the Picker (calendar pop up) defaults to that 2000 date meaning the user has to click through several years to get close to todays date. this is not a show stopper, but it is a pain for the user.

Thanks
 
Upvote 0
Or if the query would work as "All" if the two textboxes, where the date range is, is blank. Which means I would need a clear button.
 
Upvote 0
You could set a default date as you have, but in the got focus event, you could set it to perhaps 90 days prior to today, or along those lines?
That way if they do not touch it, you have your default date and if they do they have a more useful date.
You could even go further and store default and new default for each user?
 
Upvote 0
You could set a default date as you have, but in the got focus event, you could set it to perhaps 90 days prior to today, or along those lines?
That way if they do not touch it, you have your default date and if they do they have a more useful date.
You could even go further and store default and new default for each user?

Can you explain what you mean by store defaultt and new....?

Also could you use code to set the date? I have three date fields that can be filtered. Having the start and end textboxes for each is using up valuable area on my form. What options do I have? Can I have a list box to select which of the three fields and then just two textboxes for user to enter dates. Tied to code the when initiated applies the range to the appropriate field. Or can the user double click the field in the subform to initiate a pop up for the user to enter the range. Looking for unique suggestions with guidance to implement them. Thanks
 
Upvote 0
Yes to all questions.
I tested the default value/got focus event before I posted, so that is the simplest method. That is in code and using the default value property as you have already mentioned.
You can build whatever search criteria you want in vba.
I have used the doubleclick event on a control to open a form to edit that record or add a record.
 
Upvote 0

Forum statistics

Threads
1,221,692
Messages
6,161,351
Members
451,697
Latest member
pedroDH

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top