Search form problem with Date Picker

AlvaroCity

Registered User.
Local time
Today, 15:42
Joined
Jul 16, 2016
Messages
70
Hello there

I have a search form in order to show some records according to show dates from some controls.

The problem is when I choose the date from the unbounded control, this transforms the dates into American way instead of European and the outcome is wrong.

For example: If I chose 07/10/2016 from the date picker (Seventh of October). The date that displays is 10/07/2016 (Tenth of July) instead.

I am desperate. I spent so much time on this form to have such a stupid error.

I hope you can help me.

thanks
 
Dates in SQL and VB/A are always US format.
If you pass the UK format to VBA or SQL (edit: as a string) you will get US results.

Dates displayed in forms, tables etc, as long as they are actual dates and not text, should display according to your computers regional settings.

Are you using the datepicker built into Access or some third party control?
 
Hello Static

Thank you for your quick reply.

The date picker was built on Access. I had 3 similar forms and they used to work fine.
Now none of them do. Maybe its cos of the windows 10 update?

I double checked my settings and they seem to be alright.

Another thing is that sometimes the control displays in European other in American.

I have tried deleting the control and creating it again but I looks so random.
 
create > form design
add a text box
in the property sheet for the textbox set 'format' to 'General Date'
switch to form view

do you see a little calendar?
 
You could try something like this:

Code:
Private Sub MyDateField_AfterUpdate()
  Me.MyDateField = Format(Me.MyDateField, "dd/mm/yyyy")
End Sub
Once you exit the Control the date will be switched to and saved as dd/mm/yyyy.

Anyone using non-US formatted dates needs to read the article by Grand Access Guru Allen Browne (an Aussie) on the subject:

International Dates in Access

Linq ;0)>
 
Hello there

Thank you for your replies. First of all missinglinq, I don't think the problem is the code as the format seems to be okay when I debug it. It remains in European. I think that its when the code is transfer to access to the form. It changes it the date automatically.
The pic is in Spanish I hope its not an issue. Date is "Fecha"
Untitled.png
Let me know if you need the code.
 

Users who are viewing this thread

Back
Top Bottom