VBA Date Problems

RiskyP

Registered User.
Local time
Today, 16:36
Joined
Jan 3, 2013
Messages
27
Hello,

I have a VBA macro that runs an update query based on user entered values on a form. I keep getting an issue related to date formats - where date values are all in UK format "dd/mm/yyyy" for all tables and forms in the database however, when the date entered in the form is put through VBA it is automatically adjusted to American "mm/dd/yyyy" - this results in the updates not applying as records cannot be found. This only applys to dates that can be valid either way around, for instance if the date entered is 01/02/2012 I have the adjust issue, yet if the date is 17/08/2012 then the VBA recognises the UK format and updates as required.

Is there anyway to correct this so that all dates are UK format?

Thanks
 
Allen Browne discusses how to handle the different internation date formats in Access on his website
 
Thanks once again for your help!
 
Hello,

I have a VBA macro that runs an update query based on user entered values on a form. I keep getting an issue related to date formats - where date values are all in UK format "dd/mm/yyyy" for all tables and forms in the database however, when the date entered in the form is put through VBA it is automatically adjusted to American "mm/dd/yyyy" - this results in the updates not applying as records cannot be found. This only applys to dates that can be valid either way around, for instance if the date entered is 01/02/2012 I have the adjust issue, yet if the date is 17/08/2012 then the VBA recognises the UK format and updates as required.

Is there anyway to correct this so that all dates are UK format?

Thanks

Because of this type of problem you should enter your Location, and while you are at is which version of Windows and Access that you are using.

I am in the same boat so I put it in my signature.
 

Users who are viewing this thread

Back
Top Bottom