Attribute VB_Name = "Utils" Option Explicit Public Declare Function PlaySound Lib "coredll.DLL" Alias "PlaySoundW" (ByVal lpszName As String, ByVal hModule As Long, ByVal dwFlags As Long) As Long Public Const SND_ALIAS = &H10000 Public Const SND_ALIAS_ID = &H110000 Public Const SND_ALIAS_START = 0 Public Const SND_APPLICATION = &H80 Public Const SND_ASYNC = &H1 Public Const SND_FILENAME = &H20000 Public Const SND_LOOP = &H8 Public Const SND_MEMORY = &H4 Public Const SND_NODEFAULT = &H2 Public Const SND_NOSTOP = &H10 Public Const SND_NOWAIT = &H2000 Public Const SND_PURGE = &H40 Public Const SND_RESERVED = &HFF000000 Public Const SND_RESOURCE = &H40004 Public Const SND_SYNC = &H0 Public Const SND_TYPE_MASK = &H170007 Public Const SND_VALID = &H1F Public Const SND_VALIDFLAGS = &H17201F Public Function DateFormatCCYYMMDD(adate As Date, strSep As String) As String Dim astr As String Dim rstr As String rstr = CStr(Year(adate)) astr = CStr(Month(adate)) If (Len(astr) < 2) Then astr = "0" & astr rstr = rstr & strSep & astr astr = CStr(Day(adate)) If (Len(astr) < 2) Then astr = "0" & astr rstr = rstr & strSep & astr DateFormatCCYYMMDD = rstr Exit Function End Function Public Function DateStartOfWeekGet(adate As Date) Dim dwSW As Long dwSW = Weekday(adate, vbSunday) adate = DateAdd("d", (vbSunday - dwSW), adate) DateStartOfWeekGet = adate Exit Function End Function Public Function DateConvertCCYYMMDD(strDate As String, strSep As String, iFormat As Long) As String Dim strY As String, strM As String, strD As String, strDT As String Dim i As Long, ct As Long Dim adate As Date DateConvertCCYYMMDD = "" strDT = strDate ct = Len(strDate) If (ct > 0) Then i = InStr(1, strDT, strSep) strY = Left(strDT, i - 1) strDT = Right(strDT, Len(strDT) - i) i = InStr(1, strDT, strSep) strM = Left(strDT, i - 1) strDT = Right(strDT, Len(strDT) - i) strD = strDT adate = DateSerial(String2Number(strY, 0), String2Number(strM, 1), String2Number(strD, 1)) DateConvertCCYYMMDD = FormatDateTime(adate, iFormat) End If Exit Function End Function Public Sub SoundIt(which As Long) Select Case which Case 0 Call PlaySound(g_docPath & "windmax.wav", 0, SND_ASYNC + SND_NODEFAULT) Case 1 Call PlaySound(g_docPath & "exclam.wav", 0, SND_ASYNC + SND_NODEFAULT) End Select Exit Sub End Sub