473,569 Members | 2,480 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Date manipulations

Ron
Hi All (yet again today...)

Input clerk gets to "date of order" control on order form and is supposed to
enter the date of the order. I've got that defaulting to today's date,
which sounds logical...excep t that sometimes orders are made on Friday, but
not entered until the following Tuesday, or whatever. Of course, it's a
standard control, so the default date can be replaced by typing another data
with month, day, year, etc. For the lazies I've also got a calendar routine
available upon a double click of the date of order field so they can just
"click" on a day and boom, the date's entered.

Being your average SUPER LAZY USERS, this doesn't seem to suffice. They
want to change the date for the order to 2 days ago, or a week, or whatever,
but just have to type in the month number, and day number, and have the year
default to this year's date. That of course doesn't work, because the
year's blank.

I recall an old, old version of QuickBooks had this feature--you could just
enter the month, day and hit enter and get the year defaulted to the current
year--so it's not a new idea.

Any way to get Access2000 to operate this way?

TIA
ron
Mar 7 '07 #1
7 1968
On Wed, 07 Mar 2007 01:00:00 GMT, Ron wrote:
Hi All (yet again today...)

Input clerk gets to "date of order" control on order form and is supposed to
enter the date of the order. I've got that defaulting to today's date,
which sounds logical...excep t that sometimes orders are made on Friday, but
not entered until the following Tuesday, or whatever. Of course, it's a
standard control, so the default date can be replaced by typing another data
with month, day, year, etc. For the lazies I've also got a calendar routine
available upon a double click of the date of order field so they can just
"click" on a day and boom, the date's entered.

Being your average SUPER LAZY USERS, this doesn't seem to suffice. They
want to change the date for the order to 2 days ago, or a week, or whatever,
but just have to type in the month number, and day number, and have the year
default to this year's date. That of course doesn't work, because the
year's blank.

I recall an old, old version of QuickBooks had this feature--you could just
enter the month, day and hit enter and get the year defaulted to the current
year--so it's not a new idea.

Any way to get Access2000 to operate this way?

TIA
ron
If I understand your message correctly, it works fine for me.
Enter month/day , i.e. 3/4 Access will assume the current year,
3/4/2007.
That is an Access default.
If you enter the month/year, i.e. 3/2007 Access will assume the first
day of the month 3/1/2007. That is an Access default as well.

If your users are entering a valid month and day, then you must have
something else going on which is not permitting Access to assign the
current year.
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
Mar 7 '07 #2
How about...
LOCKING the control, and not allowing them an option? <grin>
=============== =============== =========
Private Sub MyCalendar_Afte rUpdate()
Me![txtOrderDate] = Me.MyCalendar
End Sub
Private Sub txtOrderDate_Ke yDown(KeyCode As Integer, Shift As Integer)
MsgBox ("Please Select a date from the Calendar.")
Me.MyCalendar.S etFocus
Me![txtOrderDate] = Me.MyCalendar
End Sub
=============== =============== =========
HTH,
Don

"Ron" <ro************ ********@verizo n.netwrote in message
news:k8oHh.366$ mh.361@trnddc05 ...
Hi All (yet again today...)

Input clerk gets to "date of order" control on order form and is supposed
to
enter the date of the order. I've got that defaulting to today's date,
which sounds logical...excep t that sometimes orders are made on Friday,
but
not entered until the following Tuesday, or whatever. Of course, it's a
standard control, so the default date can be replaced by typing another
data
with month, day, year, etc. For the lazies I've also got a calendar
routine
available upon a double click of the date of order field so they can just
"click" on a day and boom, the date's entered.

Being your average SUPER LAZY USERS, this doesn't seem to suffice. They
want to change the date for the order to 2 days ago, or a week, or
whatever,
but just have to type in the month number, and day number, and have the
year
default to this year's date. That of course doesn't work, because the
year's blank.

I recall an old, old version of QuickBooks had this feature--you could
just
enter the month, day and hit enter and get the year defaulted to the
current
year--so it's not a new idea.

Any way to get Access2000 to operate this way?

TIA
ron


Mar 7 '07 #3
On Mar 6, 11:45 pm, "Don Leverton"
<leveriteNoJunk M...@telusplane t.netwrote:
How about...
LOCKING the control, and not allowing them an option? <grin>
=============== =============== =========
Private Sub MyCalendar_Afte rUpdate()
Me![txtOrderDate] = Me.MyCalendar
End Sub

Private Sub txtOrderDate_Ke yDown(KeyCode As Integer, Shift As Integer)
MsgBox ("Please Select a date from the Calendar.")
Me.MyCalendar.S etFocus
Me![txtOrderDate] = Me.MyCalendar
End Sub
=============== =============== =========
HTH,
Don

"Ron" <ronSPAMBLOCKIN Gwest...@verizo n.netwrote in message

news:k8oHh.366$ mh.361@trnddc05 ...
Hi All (yet again today...)
Input clerk gets to "date of order" control on order form and is supposed
to
enter the date of the order. I've got that defaulting to today's date,
which sounds logical...excep t that sometimes orders are made on Friday,
but
not entered until the following Tuesday, or whatever. Of course, it's a
standard control, so the default date can be replaced by typing another
data
with month, day, year, etc. For the lazies I've also got a calendar
routine
available upon a double click of the date of order field so they can just
"click" on a day and boom, the date's entered.
Being your average SUPER LAZY USERS, this doesn't seem to suffice. They
want to change the date for the order to 2 days ago, or a week, or
whatever,
but just have to type in the month number, and day number, and have the
year
default to this year's date. That of course doesn't work, because the
year's blank.
I recall an old, old version of QuickBooks had this feature--you could
just
enter the month, day and hit enter and get the year defaulted to the
current
year--so it's not a new idea.
Any way to get Access2000 to operate this way?
TIA
ron

If they really want to be lazy try this. Make a form to play with and
put one textbox on it - name it Text11 to match what I've done. Add to
the appropriate event the following (one is a function that just gets
pasted in as is - no event for it.). User can enter date in I think
any recognized format, your calendar picker would still work and the
user could enter +3 to add three days to current date, or -2 to
subtract 2 days.
Private Sub Text11_AfterUpd ate()
FormatDateBox
End Sub

Private Sub Text11_BeforeUp date(Cancel As Integer)
If Not IsDate(Me!Text1 1.Text) And Not IsNumeric(Me!Te xt11.Text)
Then
MsgBox "The date supplied is in an invalid format.", vbOKOnly,
"Invalid Date"
Cancel = True
End If
End Sub

Function FormatDateBox()
Dim lngVal As Long

If IsDate(Me!Text1 1) Then
Me!Text11 = Format(Me!Text1 1, "Short Date")
Exit Function
End If

If IsNumeric(Me!Te xt11) Then
Me!Text11 = Date + CLng(Me!Text11)
Exit Function
End If
End Function
Mar 7 '07 #4
Ron

"fredg" <fg******@examp le.invalidwrote in message
news:15******** *************** *******@40tude. net...
On Wed, 07 Mar 2007 01:00:00 GMT, Ron wrote:
>Hi All (yet again today...)

Input clerk gets to "date of order" control on order form and is supposed
to
enter the date of the order. I've got that defaulting to today's date,
which sounds logical...excep t that sometimes orders are made on Friday,
but
not entered until the following Tuesday, or whatever. Of course, it's a
standard control, so the default date can be replaced by typing another
data
with month, day, year, etc. For the lazies I've also got a calendar
routine
available upon a double click of the date of order field so they can just
"click" on a day and boom, the date's entered.

Being your average SUPER LAZY USERS, this doesn't seem to suffice. They
want to change the date for the order to 2 days ago, or a week, or
whatever,
but just have to type in the month number, and day number, and have the
year
default to this year's date. That of course doesn't work, because the
year's blank.

I recall an old, old version of QuickBooks had this feature--you could
just
enter the month, day and hit enter and get the year defaulted to the
current
year--so it's not a new idea.

Any way to get Access2000 to operate this way?

TIA
ron

If I understand your message correctly, it works fine for me.
Enter month/day , i.e. 3/4 Access will assume the current year,
3/4/2007.
That is an Access default.
If you enter the month/year, i.e. 3/2007 Access will assume the first
day of the month 3/1/2007. That is an Access default as well.

If your users are entering a valid month and day, then you must have
something else going on which is not permitting Access to assign the
current year.
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
Boy, there for a second, I thought we were on different planets. A date
field defaulting to 3/1/2007 if all you put in is 3/2007? Defaulting to
3/27/2007 if all you put in was 3/27? Mine don't allow that on ANY of my
screens!

But then I tried a new table with date field, text field and started adding
dates to just the table, and viola...it works as you say. So, what am I
doing differently on all my forms?

Every single date control I brought onto a form I ALSO set up with a Input
Mask. THAT is what's requiring the year, etc.

I'll play around with taking the format off and see how that floats my
user's boats.

Of course, if I make it too easy for them to enter data the only next step
is to allow entry by osmosis. Oh, wait. That would require them to
think...

Thanks much for the tip.
ron
Mar 7 '07 #5
On Mar 7, 1:50 pm, "Ron" <ronSPAMBLOCKIN Gwest...@verizo n.netwrote:
"fredg" <fgutk...@examp le.invalidwrote in message

news:15******** *************** *******@40tude. net...
On Wed, 07 Mar 2007 01:00:00 GMT, Ron wrote:
Hi All (yet again today...)
Input clerk gets to "date of order" control on order form and is supposed
to
enter the date of the order. I've got that defaulting to today's date,
which sounds logical...excep t that sometimes orders are made on Friday,
but
not entered until the following Tuesday, or whatever. Of course, it's a
standard control, so the default date can be replaced by typing another
data
with month, day, year, etc. For the lazies I've also got a calendar
routine
available upon a double click of the date of order field so they can just
"click" on a day and boom, the date's entered.
Being your average SUPER LAZY USERS, this doesn't seem to suffice. They
want to change the date for the order to 2 days ago, or a week, or
whatever,
but just have to type in the month number, and day number, and have the
year
default to this year's date. That of course doesn't work, because the
year's blank.
I recall an old, old version of QuickBooks had this feature--you could
just
enter the month, day and hit enter and get the year defaulted to the
current
year--so it's not a new idea.
Any way to get Access2000 to operate this way?
TIA
ron
If I understand your message correctly, it works fine for me.
Enter month/day , i.e. 3/4 Access will assume the current year,
3/4/2007.
That is an Access default.
If you enter the month/year, i.e. 3/2007 Access will assume the first
day of the month 3/1/2007. That is an Access default as well.
If your users are entering a valid month and day, then you must have
something else going on which is not permitting Access to assign the
current year.
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail

Boy, there for a second, I thought we were on different planets. A date
field defaulting to 3/1/2007 if all you put in is 3/2007? Defaulting to
3/27/2007 if all you put in was 3/27? Mine don't allow that on ANY of my
screens!

But then I tried a new table with date field, text field and started adding
dates to just the table, and viola...it works as you say. So, what am I
doing differently on all my forms?

Every single date control I brought onto a form I ALSO set up with a Input
Mask. THAT is what's requiring the year, etc.

I'll play around with taking the format off and see how that floats my
user's boats.

Of course, if I make it too easy for them to enter data the only next step
is to allow entry by osmosis. Oh, wait. That would require them to
think...

Thanks much for the tip.
ron

Keep in mind the Format and Input Mask are different things. The Input
Mask *requires* you to enter data a certain way, a format will display
the underlying value a different way.

Mar 7 '07 #6

....
If they really want to be lazy try this. Make a form to play with and
put one textbox on it - name it Text11 to match what I've done. Add to
the appropriate event the following (one is a function that just gets
pasted in as is - no event for it.). User can enter date in I think
any recognized format, your calendar picker would still work and the
user could enter +3 to add three days to current date, or -2 to
subtract 2 days.
OR

They could just click on a different date on the Calendar control. <grin>
("KISS" rule)
(I am assuming, however, that your users CAN count to 3.) <big grin>

The (correctly formatted) date changes as the use selects a date on the
calendar.
I'm not trying to be a real smarty-pants here ... I've just had all I can
take of "MM/DD/YY vs DD/MM/YY vs MM/DD/YYYY vs DD/MM/YYYY formats and '# &
Mydate & #' issues!

It's especially an issue here in Canada, where the "official" format is
DD/MM/YYYY.
We also spell words like "colour" instead of "color" :)

Like I said earlier ... my theory is: "Don't give them the chance to mess it
up."
Mar 8 '07 #7
Tom
Another option, if most of the back dates fall within a small range,
is to set up a combobox with values of:
* today
* today -1 day
* etc

Works pretty well for 5-7 days, and still allows the user to enter any
date they want (if you set LimitToList = false) if they are really
behind the curve.

Tom

Mar 8 '07 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
9276
by: perplexed | last post by:
How do you convert a user inputted date to a unix timestamp before insterting it into your database? I have a form, with a textfield for a date that the user inputs in the format mm-dd-yyyy and three dropdow boxes for hours, minutes, and AM/PM. All of these need to be considered together and converted to one Unix Timestamp and then inserted...
7
3202
by: middletree | last post by:
I know that if I have a full timestamp, and wrap the DateValue function around it, it will give me mm/dd/yyyy. I can't seem to find a similar function which would return a 2-digit year. Is there such a thing?
2
4149
by: Tjerk | last post by:
Hello all, I have the script below to change an image depending on the date upto january it worked fine but then it just stopped working does anybody have an idea how I can make it work again or why it doesn't work? Thanks in advance Tjerk
9
3454
by: ME | last post by:
can someone tell me how to make this first one work??, located here: http://javascript.about.com/library/scripts/blshowdatetime.htm#examplesource This second one, well, dreamweaver eats the code, removes the code as bad. Any help here? Please? 2nd located here: http://www.dynamicdrive.com/dynamicindex6/clock3.htm Appreciated, M.E.
3
23804
by: usenet | last post by:
I have inherited a table where date information was saved from PHP as a VARCHAR. (Sigh.) This means that the so-called date fields look like this : August 1, 2005, 9:09 am EDT October 13, 2004, 12:28 pm EDT This makes them essentially useless for sorting and logical evaluation. Understandbly, the MySQL date functions don't seem able to...
5
13244
by: Arjen | last post by:
Hello, How can I make the first letter uppercase? ToString("ddd. dd MMMM yyyy") This ddd. will be for example monday, I want to see Monday. Thanks!
2
1516
by: news.microsoft.com | last post by:
What is the best way to avoid string manipulations with SQL? I have edit box control where database is opened for attacks through SQL commands. Something like this: selectString = "SELECT FIRSTNAME, LASTNAME FROM xxxTable WHERE FIRSTNAME='"+txtTextBox1.Text"'"; Furthermore I would like to avoid of using some characters like ;:,. etc.
6
4311
by: Tim N. van der Leeuw | last post by:
Hi, I want to parse strings containing date-time, which look like the following: "Mon Dec 19 11:06:12:333 CET 2005" That's a problem for strptime it seems, b/c I cannot find any format-spec for the milliseconds-part in here. (I'm also not sure about the validity of the tz part, but ...)
1
3217
by: cjordan | last post by:
Hi everyone. I'm new here, and I think I've got a pretty unique problem (haven't found any solution to this anywhere else), but I'm hoping that someone here can help me. To be honest, I'm not a DB2 guy. I'm a contractor working for a client who uses a very old AS400 to do their payroll. They're running V5R3. I'm not sure if that refers to the...
0
7615
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8130
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7979
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6284
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5514
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5219
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3653
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3643
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1223
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.