Home code VBA: Format a date field in MS Access

VBA: Format a date field in MS Access

711
0

There are a ton of ways you can do this, but one of the easiest is to simply save the field with all the numerals for the date into a “Date” format under the Table field properties.  But before you do that, you have to add some formatting so that Access 97 recognizes it as a date and doesn’t throw them all out as invalid.

Here is a simple code: Mid([tblName]![DOB],1,4)+”/”+Mid([tblName]![DOB],5,2)+”/”+Mid([tblName]![DOB],7,2)

LEAVE A REPLY

Please enter your comment!
Please enter your name here