Anda di halaman 1dari 5

Attribute VB_Name = "CommonMod" Option Explicit Public Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long) Public

mainFrmCaption 'my profile Public Const Public Const Public Const Public Const Public Const Public Const nfoplan.com" '////////// As String

conDBfirstLetter = "d" 'data conOurName = "Realsoft Infoplan " conProductandVer = "CApack Ver 2.0 " conProductDes = "Financial Accounts Package" conOurSimpleAddress = "Realsoft Infoplan - India" conOurSimpleTooltip = "Phone: 91-9387201232 Mail: service@realsofti

Public Const conMnuError = "Task not found " Public Const conSureTodelete = " Are you sure to delete this record ? " Public Const conNoRecord = " There is no record found on your demand" Public Const conYes = "YesYes#" Public Const conNo = "NoNo#" Public Const conSaved = "Data successfully saved" Public Const conDeleted = "Deleted!" Public Const conInvalidPwd = "Invalid password or user name. Please verify" Public Const conPwdNotmatch = "The password confirmation does not match" Public Const conAddmode = "Adding new records..." Public Const conEditmode = "Editing existing records..." Public Const conSaveQues = "Do you want to save the records ?" Public Const conCantBlank = "This data can not be blank" Public Const conINVfyear = "Invalid financial year. Verify" Public Const conAlreadyExists = "Data already exists" Public Const conNorights = "User don't have rights to perform this task" Public Const conAllownum = "123456789.0" Public Const conRelatedRecords = "This record cannot be deleted or " & _ "changed. It is related with some other records" Public Const conInvDate = "Invalid date Or Not with in financial year. Verify!" Public Const conFirstRecord = "This is the first record. No more record in back" Public Const conLastRecord = "This is the last record. No more record in front" Public Const conInvalidData = "Invalid data. Cannot allow" Public Const conDateDiff = "To date is lesser than from date. Please correct it" Public Const conSameHead = "Same head detected in both Dr and Cr" Public Const conDoYouCloseWindow = "Do you want to close this window?" Public Const conAreyousure = "Are you sure to perform this action?" Public Const conDBPassword = "peacepalaceis" Public Const conInvalidSelection = "Invalid selection...." Public Enum MsgMatter Norecordx DeleteQuestionx MenuErrorx Savedx PasswordnoMatchx DoyouWanttoSavex CannotBlankx InvalidPasswordx Deletedx InvalidFyearx DataAlreadyx Norightsx Relatedwithothersx invDatex

FirstRecordX LastRecordX InvalidDataX DateDiffx SameHeadx DoYouCloseWindowX AreuSurex InvalidSelectionx End Enum Public Function MSG(msgWaction As MsgMatter, Optional ErrDisplay As String) As S tring If ErrDisplay = conYes Then Error.Show 1 Exit Function End If If Err.Description <> "" Then Err.Clear Select Case msgWaction Case MsgMatter.DeleteQuestionx If MsgBox(conSureTodelete, vbQuestion + vbYesNo + vbDefaultButton2) = vbYes Then MSG = conYes Else MSG = conNo End If Case MsgMatter.Norecordx MsgBox conNoRecord, vbExclamation Case MsgMatter.MenuErrorx MsgBox conMnuError, vbInformation Case MsgMatter.Savedx MsgBox conSaved, vbInformation Case MsgMatter.PasswordnoMatchx MsgBox conPwdNotmatch, vbInformation Case MsgMatter.InvalidPasswordx MsgBox conInvalidPwd, vbInformation Case MsgMatter.DoyouWanttoSavex If MsgBox(conSaveQues, vbQuestion + vbYesNo + vbDefaultButton1) = vbYes The n MSG = conYes Else MSG = conNo End If Case MsgMatter.CannotBlankx MsgBox conCantBlank, vbInformation Case MsgMatter.Deletedx MsgBox conDeleted, vbExclamation Case MsgMatter.InvalidFyearx MsgBox conINVfyear, vbExclamation

Case MsgMatter.DataAlreadyx MsgBox conAlreadyExists, vbExclamation Case MsgMatter.Norightsx MsgBox conNorights, vbInformation Case MsgMatter.Relatedwithothersx MsgBox conRelatedRecords, vbExclamation Case MsgMatter.invDatex MsgBox conInvDate, vbExclamation Case MsgMatter.FirstRecordX MsgBox conFirstRecord, vbExclamation Case MsgMatter.LastRecordX MsgBox conLastRecord, vbExclamation Case MsgMatter.InvalidDataX MsgBox conInvalidData, vbExclamation Case MsgMatter.DateDiffx MsgBox conDateDiff, vbExclamation Case MsgMatter.SameHeadx MsgBox conSameHead, vbExclamation Case MsgMatter.DoYouCloseWindowX If MsgBox(conDoYouCloseWindow, vbOKCancel + vbQuestion + vbDefaultButton1) = vbOK Then MSG = conYes Else MSG = conNo End If Case MsgMatter.AreuSurex If MsgBox(conAreyousure, vbYesNo + vbExclamation) = vbYes Then MSG = conYes Else MSG = conNo End If Case MsgMatter.InvalidSelectionx MsgBox conInvalidSelection, vbExclamation End Select End Function Public Function VerifyPath() As Boolean 'ccode As Integer, fyearx As Integer VerifyPath = False If Dir(SayFileName) <> "" Then VerifyPath = True Else VerifyPath = False End If End Function Public Function AllowandConvert(O_toNumber_1_to_UCase As Byte, InputKeyAscii As Integer) As Integer If InputKeyAscii = 39 Then

AllowandConvert = 0 Exit Function End If If InputKeyAscii = 13 Or InputKeyAscii = 8 Or InputKeyAscii = 27 Then AllowandConvert = InputKeyAscii Exit Function End If Select Case O_toNumber_1_to_UCase Case 0 If InStr(conAllownum, Chr(InputKeyAscii)) = 0 Then AllowandConvert = 0 Else AllowandConvert = InputKeyAscii End If Case 1 AllowandConvert = Asc(UCase(Chr(Val(InputKeyAscii)))) End Select End Function Public Sub SpreadClear(SPname As vaSpread, Optional RowReSet_8 As Byte) SPname.Row = 1: SPname.Row2 = SPname.MaxRows SPname.Col = 1: SPname.Col2 = SPname.MaxCols SPname.Text = "" SPname.BlockMode = True SPname.Action = 12 SPname.BlockMode = False SPname.Action = 0 If RowReSet_8 = 8 Then SPname.MaxRows = 1 End Sub Public Sub EnablingAllTmpmnu() Mainfrm.mnuT1(0).Enabled = True Mainfrm.mnuT1(1).Enabled = True Mainfrm.mnuT1(3).Enabled = True Mainfrm.mnuT1(5).Enabled = True End Sub Function SayFileName() As String SayFileName = App.Path & "\data\" & conDBfirstLetter & IntCompanyCode & intFyear & ".mdb" End Function Public Sub ReportSetting(mename As Form, Filenamex As String) mename.Cry.DataFiles(0) = SayFileName mename.Cry.ReportFileName = App.Path & "\report\" & Filenamex & ".rpt" mename.Cry.Password = Chr(10) & conDBPassword mename.Cry.Formulas(0) = "zcompany = '" & strCompanyName & "'" mename.Cry.Formulas(1) = "zaddress = '" & strCompanyAddress & "'" mename.Cry.Formulas(2) = "zarea = '" & strCompanyArea & "'" mename.Cry.Formulas(3) = "zdist = '" & strCompanyDist & "'" End Sub Public Dim A1 Dim b1 Dim c1 Dim D1 Function ReportDateFilter(mename As Form, DateField As String) As String As String As String As String As String

Dim E1 As String Dim f1 As String A1 = Format(mename.Eddate(0).Text, "yyyy") & "," b1 = Format(mename.Eddate(0).Text, "mm") & "," c1 = Format(mename.Eddate(0).Text, "dd") D1 = Format(mename.Eddate(1).Text, E1 = Format(mename.Eddate(1).Text, f1 = Format(mename.Eddate(1).Text, ReportDateFilter = "{" & DateField "to Date (" & D1 & E1 & f1 & ")" End Function Public Sub makeBeauty(Frm As Form) Dim intLoop As Integer "yyyy") & "," "mm") & "," "dd") & "} in Date (" & A1 & b1 & c1 & ")" & " " &

' Counter

' Set the pen parameters Frm.DrawStyle = vbInsideSolid Frm.DrawMode = vbCopyPen Frm.ScaleMode = vbPixels Frm.DrawWidth = 8 Frm.ScaleWidth = 176 ' Shade the form For intLoop = 0 To 175 Frm.Line (intLoop, 0)-(intLoop - 1, Screen.Height), RGB(0, intLoop, intL oop), B Next intLoop End Sub

Anda mungkin juga menyukai