' Format a date as a DateSerial for Access' Example: Debug.Print GetDBDate(date)Public Function GetDBDate(sDate As String) As String On Error GoTo ERROR_GetDBDate Dim sTmp As String If IsDate(sDate) = False Then sTmp = sDate Else sTmp = "DateSerial(" & Year(sDate) & ", " & Month(sDate) & ", " & Day _ (sDate) & ")" End IfEXIT_GetDBDate: GetDBDate = sTmp Exit FunctionERROR_GetDBDate: sTmp = sDate Resume EXIT_GetDBDateEnd Function'========================================' You can find more routines like this on www.vbdiamond.com,' a site devoted to VB developers'========================================
Charlie has over a decade of experience in website administration and technology management. As the site admin, he oversees all technical aspects of running a high-traffic online platform, ensuring optimal performance, security, and user experience.






















