'************************************************************************************ Function ct_CheckDate(ByVal dateFld) 'Verilen tarihin geçerli bir tarih olup olmadığını kontrol eder 'İşlem başarılı sonuçlanmışsa True, aksi takdirde False döndürür. On Error Resume Next Dim y y = FormatDateTime(dateFld, vbShortDate) If Err <> 0 Then ct_CheckDate = False Else ct_CheckDate = IsDate(dateFld) End If End Function '************************************************************************************ Function ct_FormatMyDate(x) ct_FormatMyDate = FormatDateTime(x, vbShortDate) End Function '************************************************************************************ Function ct_CheckNumeric(ByVal numFld) 'Verilen sayının geçerli bir sayı olup olmadığını kontrol eder 'İşlem başarılı sonuçlanmışsa True, aksi takdirde False döndürür. On Error Resume Next Dim y y = FormatNumber(numFld) If Err <> 0 Then ct_CheckNumeric = False Else ct_CheckNumeric = IsNumeric(numFld) End If End Function '************************************************************************************ Function ct_FormatMyNumber(x) ct_FormatMyNumber = FormatNumber(x) End Function '************************************************************************************ Function ct_CheckInteger(ByVal numFld) 'Verilen sayının geçerli bir tamsayı olup olmadığını kontrol eder 'İşlem başarılı sonuçlanmışsa True, aksi takdirde False döndürür. On Error Resume Next Dim y y = FormatNumber(numFld) If Err <> 0 Then ct_CheckInteger = False Else If Not IsNumeric(numFld) Then ct_CheckInteger = False Else ct_CheckInteger = ( CStr(Fix(numFld)) = CStr( FormatNumber(numFld, 0, 0, 0) ) ) End If End If End Function '************************************************************************************ Function ct_FormatMyInteger(x) ct_FormatMyInteger = FormatNumber(x, 0) End Function '************************************************************************************ Function ct_CheckCurrency(ByVal curFld) 'Verilen parasal sayının geçerli bir sayı olup olmadığını kontrol eder. 'İşlem başarılı sonuçlanmışsa True, aksi takdirde False döndürür. On Error Resume Next Dim y y = CCur(curFld) If Err <> 0 Then ct_CheckCurrency = False Else ct_CheckCurrency = IsNumeric(y) End If End Function '************************************************************************************ Function ct_FormatMyCurrency(x) ct_FormatMyCurrency = FormatCurrency(x) End Function '************************************************************************************ Function ct_GetDateDMY(ByVal sDay, ByVal sMonth, ByVal s4DigYear) 'Gönderilen gün-ay ve 4 basamaklı yıl bilgisinden client formatli 'tarihi döndürür. ct_GetDateDMY = "" Dim sClientDate sClientDate = "dd.MM.yyyy" if Len(sDay) = 1 Then sClientDate = Replace(sClientDate, "dd", "0" & sDay) Elseif Len(sDay) = 2 Then sClientDate = Replace(sClientDate, "dd", sDay) Else sClientDate = Replace(sClientDate, "dd", "0" & sDay) End If If Len(sMonth) = 1 Then sClientDate = Replace(sClientDate, "MM", "0"&sMonth) Else sClientDate = Replace(sClientDate, "MM", sMonth) End If sClientDate = Replace(sClientDate, "yyyy", s4DigYear) sClientDate = Replace(sClientDate, "yy", Right(s4DigYear, 2)) ct_GetDateDMY = sClientDate End Function Function vbs_getYear(sDate) vbs_getYear = "" If IsDate(sDate) Then vbs_getYear = Year(sDate) End If End Function Function vbs_getMonth(sDate) vbs_getMonth = "" If IsDate(sDate) Then vbs_getMonth = Month(sDate) End If End Function Function vbs_getDay(sDate) vbs_getDay = "" If IsDate(sDate) Then vbs_getDay = Day(sDate) End If End Function