Physical Address
304 North Cardinal St.
Dorchester Center, MA 02124
Physical Address
304 North Cardinal St.
Dorchester Center, MA 02124

Part 3 is the pivotal step where the Chart of Accounts (COA), the backbone of the financial system, is built, along with an innovative custom pop-up alert system.
1. The Chart of Accounts Database Structure:
tbl_ChartOfAccounts): Defines the five primary types: Assets, Liabilities, Equity, Revenue, and Expenses.Account Number, Name, Balance) and includes a Foreign Key (AccID) linking it to the Parent table.2. Building the ‘Chart of Accounts’ Form:
frm_ChartOfAccounts to be build in Continuous Subform bound to the tbl_ChartOfAccounts.3. Building the ‘Add Group Account’ Form:
frm_AddGroupAccount is set to open in Dialog Mode.On Click event uses the DMax function to find the largest existing account number under the selected type and adds 1 for the new unique number.After Update event checks for existing duplicate names under the same primary type and provides instant visual feedback via icons.4. Creating the Modern Pop-up Alert System:
Alert_frm) is designed with a Label for the message and a set of 20 hidden boxes for the animation.On Timer event drives the animation by sequentially making the 20 boxes visible, pausing, and then closing the form. This custom form is used to replace all standard Access message boxes.
This part establishes the Chart of Accounts (COA) and an innovative, universal custom pop-up alert system for professional user feedback.
tbl_ChartOfAccounts)| Field Name | Data Type | Purpose |
|---|---|---|
AccID | AutoNumber (Primary Key) | Unique ID for the log entry. |
AccNumber | Number | Account Number |
AccName | Text | Name of the primary type (e.g., ‘Assets’, ‘Liabilities’). |
AccGroup | Text | Group or Category of the Accounts |
AccDescription | Text | A description of the Account. |
AccType | Text | Type of Account (e.g., ‘Builtin’ for default accounts |
AccBalance | Currency | Opening Balance amount of the account |
tbl_ChartOfAccountsSUB)| Field Name | Data Type | Purpose |
|---|---|---|
AccSubID | AutoNumber (Primary Key) | Unique ID for the log entry. |
AccID | Number (Foreign Key) | Links to the parent account ‘tbl_ChartOfAccounts’ |
AccCommonID | Number | Name of the primary type (e.g., ‘Assets’, ‘Liabilities’). |
AccSubID | Text | Group or Category of the Accounts |
AccSubNm | Text | A description of the Account. |
AccSubDetail | Text | Type of Account (e.g., ‘Builtin’ for default accounts |
AccSubBalance | Currency | Opening Balance amount of the account |
frm_ChartOfAccounts)frm_ChartOfAccounts) is created as a Continuous Subform bound to the tbl_ChartOfAccounts.frm_AddGroupAccount)On Click event of the Primary Account List Box.DMax function to find the largest existing account number (Number field) associated with the selected Account_ID.1 to the maximum value found to generate the new, unique account number.Private Sub ListSelectPrimary_Click()
'Actually we need to add Primary account number
Me.txtGroupNumber = DMax("AccNumber", "tbl_ChartOfAccounts", "AccName= '" & Me.ListSelectPrimary & "'") + 1
End SubAfter Update event of the Account Group Name text box.Name and the selected Account_ID.Private Sub txtAccGroup_AfterUpdate()
'Define a variable to store DCOUNT value
AG = DCount("AccGroup", "tbl_ChartOfAccounts", "AccGroup = '" & Me.txtAccGroup & "'")
If AG = 0 Then
Me.CmdGnok.Visible = False
Me.CmdGok.Visible = True
ElseIf AG > 0 Then
Me.CmdGnok.Visible = True
Me.CmdGok.Visible = False
End If
End SubThe Submit button’s VBA code ensures data is clean: checks mandatory fields, blocks submission if the duplicate icon is visible, inserts the data, and then refreshes the main COA display form.
Private Sub cmdAddGroupSubmit_Click()
'Madatory fields check to be filled
If IsNull(Me.ListSelectPrimary) = True Or IsNull(Me.txtAccGroup) = True Then
MsgBox "Mandatory fields must be filled.", vbExclamation, "|Empty Fields|"
Exit Sub
Else
If Me.CmdGnok.Visible = True Then
MsgBox "The Group name already exists.", vbCritical, "|Not Allowed|"
Exit Sub
Else
'Proceeding to insert data into the table
Set rst = CurrentDb.OpenRecordset("tbl_ChartOfAccounts", dbOpenDynaset, dbSeeChanges)
With rst
.AddNew
.Fields("AccNumber") = Me.txtGroupNumber
.Fields("AccName") = Me.ListSelectPrimary
.Fields("AccGroup") = Me.txtAccGroup
.Fields("AccDescription") = Me.txtAccDescription
'Let the Type empty other than Builtin
.Update
End With
Set rst = Nothing
'MsgBox "The Account has been created successfully.", vbInformation, "|Account Created|"
DoCmd.Close acForm, "frm_AddGroupAccount"
'\\\MsgPopup
DoCmd.OpenForm "frm_msgpopup"
Forms!frm_msgpopup.Form.LblMsgPopup.Caption = "Account has been created..."
'Refresh the data in the Main form
Forms!MainDashboard!NavigationSubform.Form.Requery
End If
End If
End SubAlert_frm)
On Timer event sequentially makes the 20 hidden boxes visible to create a fade-in effect.Private Sub Form_Timer()
If Me.txtMsgCount = 50 Then
DoCmd.Close acForm, "frm_msgPopup"
Else
Me.txtMsgCount = Me.txtMsgCount + 1
If Me.txtMsgCount = 2 Then
Me.BxP1.Visible = True
ElseIf Me.txtMsgCount = 3 Then
Me.BxP2.Visible = True
ElseIf Me.txtMsgCount = 4 Then
Me.BxP3.Visible = True
ElseIf Me.txtMsgCount = 5 Then
Me.BxP4.Visible = True
ElseIf Me.txtMsgCount = 6 Then
Me.BxP5.Visible = True
ElseIf Me.txtMsgCount = 7 Then
Me.BxP6.Visible = True
ElseIf Me.txtMsgCount = 8 Then
Me.BxP7.Visible = True
ElseIf Me.txtMsgCount = 9 Then
Me.BxP8.Visible = True
ElseIf Me.txtMsgCount = 10 Then
Me.BxP9.Visible = True
ElseIf Me.txtMsgCount = 11 Then
Me.BxP10.Visible = True
ElseIf Me.txtMsgCount = 12 Then
Me.BxP11.Visible = True
ElseIf Me.txtMsgCount = 13 Then
Me.BxP12.Visible = True
ElseIf Me.txtMsgCount = 14 Then
Me.BxP13.Visible = True
ElseIf Me.txtMsgCount = 15 Then
Me.BxP14.Visible = True
ElseIf Me.txtMsgCount = 16 Then
Me.BxP15.Visible = True
ElseIf Me.txtMsgCount = 17 Then
Me.BxP16.Visible = True
ElseIf Me.txtMsgCount = 18 Then
Me.BxP17.Visible = True
ElseIf Me.txtMsgCount = 19 Then
Me.BxP18.Visible = True
ElseIf Me.txtMsgCount = 20 Then
Me.BxP19.Visible = True
ElseIf Me.txtMsgCount = 21 Then
Me.BxP20.Visible = True
End If
End If
End Sub