age
1 TopicNeed Your Help! How to Convert Date of Birth from Digits to Words (Text) Ms Access?
i am beginner dont understand coding very well, i saw a post in which i get code but i dont know it will work or now and i dont know how to use it in VBA. can anybody teach me ? Like 1/1/2000 First January of Two Thousand Option Compare Database Option Explicit Sub Test() Dim TestDate As Date TestDate = CDate("11.04.2013") Dim dtString As String dtString = DateInWords(TestDate) MsgBox (dtString) End Sub Function DateInWords(dt As Date) As String Dim strDays As String, SplitDays strDays = "Day_1,Day_2,Day_3,Day_4,Day_5,Day_6,Day_7,Day _8,D ay_9,Day_10,Day_11,Day_12,Day_13,Day_14,Day_15,Day _16,Day_17,Day_18,Day_19,Day_20,Day_21,Day_22,Day_ 23,Day_24,Day_25,Day_26,Day_27,Day_28,Day_29,Day_3 0,Day_31" SplitDays = Split(strDays, ",") Dim strMothes As String, SplitMonthes strMothes = "Month_1,Month_2,Month_3,Month_4,Month_5,Month _6,M onth_7,Month_8,Month_9,Month_10,Month_11,Month_12" SplitMonthes = Split(strMothes, ",") Dim strYears As String, SplitYears strYears = "Year_2010,Year_2011,Year_2012,Year_2013,Year_ 2014 ,Year_2015,Year_2016,Year_2017,Year_2018,Year_2019 ,Year_2020" SplitYears = Split(strYears, ",") Dim strDay As String strDay = SplitDays(Day(dt) - 1) Dim strMonth As String strMonth = SplitMonthes(Month(dt) - 1) Dim strYear As String strYear = SplitYears(Year(dt) - 2010) DateInWords = strDay & " " & strMonth & ", " & strYear End Function3.4KViews0likes4Comments