DTPicker Intermittent Date flipping

S

Sean Timmons

Not sure what else to call this issue.

I have multiple users entering data into two separate forms.

Both forms use DTPicker to allow for date selection.

Both associated tables have a default value of Now() in the date field.

Most of the time, there would be no need to update the date, so often the
user will
complete the form without looking at the date.

Recently, there appears to be an intermittent issue where the month and day
poriont of the date are flipping, so I'll get a records from 5/11/08 when
it's really from 11/5/08.

Is this a typical issue? Is there some way to fix it? Help!
 
D

Douglas J. Steele

Do you have any code that updates the table based on the date picker? If so,
what is it?

It's possible that the users who end up with 5/11/08 have their Short Date
format set to dd/mm/yyyy (through Regional Settings in the Control Panel).
 
S

Sean Timmons

sorry for the delay!

The issue is occuring with multiple users, but not on all of their forms.

I do have a bit of code on the date, because I couldn't figure out how to
remove the time portion of the date otherwise:

[Date of Audit] = DatePart("d", [Date of Audit]) & "/" & DatePart("m", [Date
of Audit]) & "/" & DatePart("yyyy", [Date of Audit])

I tried ROUND(), but that would round up for anything completed after noon.
Maybe if I could figure out how to do that, it'd fix the other issue?
 
D

Douglas J. Steele

If you don't want time, use Date() as the default, not Now()

To remove time from a value, use the DateValue() function.

My advice would be never rely on default conversion. If you need to
construct a date by pieces, use the DateSerial function.

In other words, while the first two solutions I posted are what you should
be doing, your calculation would better be

[Date of Audit] = DateSerial(DatePart("yyyy", [Date of Audit]),
DatePart("m", [Date of Audit]), DatePart("d", [Date of Audit]))

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Sean Timmons said:
sorry for the delay!

The issue is occuring with multiple users, but not on all of their forms.

I do have a bit of code on the date, because I couldn't figure out how to
remove the time portion of the date otherwise:

[Date of Audit] = DatePart("d", [Date of Audit]) & "/" & DatePart("m",
[Date
of Audit]) & "/" & DatePart("yyyy", [Date of Audit])

I tried ROUND(), but that would round up for anything completed after
noon.
Maybe if I could figure out how to do that, it'd fix the other issue?

Douglas J. Steele said:
Do you have any code that updates the table based on the date picker? If
so,
what is it?

It's possible that the users who end up with 5/11/08 have their Short
Date
format set to dd/mm/yyyy (through Regional Settings in the Control
Panel).
 
S

Sean Timmons

Bah, I knew it was a simple function. My Excel experience is not helping me
with my VB. Date() fixes all of my problems. Thank you very much!

Douglas J. Steele said:
If you don't want time, use Date() as the default, not Now()

To remove time from a value, use the DateValue() function.

My advice would be never rely on default conversion. If you need to
construct a date by pieces, use the DateSerial function.

In other words, while the first two solutions I posted are what you should
be doing, your calculation would better be

[Date of Audit] = DateSerial(DatePart("yyyy", [Date of Audit]),
DatePart("m", [Date of Audit]), DatePart("d", [Date of Audit]))

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Sean Timmons said:
sorry for the delay!

The issue is occuring with multiple users, but not on all of their forms.

I do have a bit of code on the date, because I couldn't figure out how to
remove the time portion of the date otherwise:

[Date of Audit] = DatePart("d", [Date of Audit]) & "/" & DatePart("m",
[Date
of Audit]) & "/" & DatePart("yyyy", [Date of Audit])

I tried ROUND(), but that would round up for anything completed after
noon.
Maybe if I could figure out how to do that, it'd fix the other issue?

Douglas J. Steele said:
Do you have any code that updates the table based on the date picker? If
so,
what is it?

It's possible that the users who end up with 5/11/08 have their Short
Date
format set to dd/mm/yyyy (through Regional Settings in the Control
Panel).

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Not sure what else to call this issue.

I have multiple users entering data into two separate forms.

Both forms use DTPicker to allow for date selection.

Both associated tables have a default value of Now() in the date field.

Most of the time, there would be no need to update the date, so often
the
user will
complete the form without looking at the date.

Recently, there appears to be an intermittent issue where the month and
day
poriont of the date are flipping, so I'll get a records from 5/11/08
when
it's really from 11/5/08.

Is this a typical issue? Is there some way to fix it? Help!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top