Solved

Accounting Entries!

Posted on 2002-03-09
11
345 Views
Last Modified: 2012-06-21
Hello,

I am trying to write a small accounting application.  So, could you suggest a way to save entries so that it will be easy to get reports...

At present, I am creating a debitside table and a creditside table for each personal account, real account,and nominal accounts, then entering the debit side account name in the creditside table and the credit side accout name in the debit side table.  And, I save the tablenames (account names) in a table and then calculate the total of each account via while loop and then display the balance.  The problem occurs when there are multiple debits/credits in a posting.

Am I doing correctly...Is there a better way to saving the posting?

Please help.
0
Comment
Question by:shankarkrupa
  • 4
  • 3
  • 3
  • +1
11 Comments
 
LVL 1

Expert Comment

by:K7
ID: 6852895
Hi
i'm not exactly sure if i understood everything corectly.

Firstly, it is nearly certanly much more efficient to use a SQL statement to calculate the balsnce rather than a loop in VB. I can help u with the SQL if u need.

What do u mean by Posting??

Also from what i cna gather i would prbably use a different db design, one based on 2 tables. Where there is a table containing all the account detales and and accountID.  The other table would contain all the transactions and and there detales.  Between the tables would be one to many relationship.  I'm not sure if understood this right but if 2 pesonal accounts can be contained  winside one real account then u could make the relation ship between the 2 tables a many to many.

i hope this haelps a bit

Cat



0
 
LVL 8

Expert Comment

by:glass_cookie
ID: 6854499
Hi!

If the number of fields are small, you coud save them into a text file of a certain format.  If not, you may want to use a database file to store the details, (eg. Access?)

For the text files (which is what I normally use), I'll load the data/fields into listboxes.  The data would also be sorted for me as there's a Sorted property for listboxes.

Let me know if you want any coding for that ; )

Tha'ts it!

glass cookie : )
0
 
LVL 3

Author Comment

by:shankarkrupa
ID: 6854693
Hello k7,
I do not know how to calculate the total using a single sql statement for so many tables...Is it possible?  What for I use the while loop is I get the account names from a table, and then till that table reach the end of file, I open all the account names (again another table(s)) and then store all those total from that table in a variable.

This what I do:

The company has two customers CusA, CusB, and two debtors DebA, DebB.

So, in the accountnames table, I have these records:
CusA
CusB
DebA
DebB
Purchases
Sales
Expenses

Similarly, in the mdb file, I have these tables:

AccountNames
CrCusA
CrCusB
CrDebA
CrDebB
CrExpenses
CrPurchases
CrSales
DrcusA
DrCusB
DrDebA
DrDebB
DrExpenses
DrPurChases
DrSales

So, that is it..Of course, I have two cash and bank accounts also; so, it is:

CrCash
CrBank
DrCash
DrBank

And so on.  The idea is, two sides for each account, one Dr(debit side) and one Cr(Credit side).

By "posting", I mean recording of a transaction, posting an entry in the ledger.

>I'm not sure if understood this right but if 2 pesonal accounts can be contained  winside one real account
then u could make the relation ship between the 2 tables a many to many.

Could you be a bit detailed on that line?

One more thing, would it help the performance if I store the data in more tables, instead of keeping it just in one single table.

Of course glass_cookie, the fields are small, only 5-6 fields in a table.  Would storing data in a textfile mean taking more harddrive space?

Would the calculation and data display be speedier than that of the database?  Please advise, glass_cookie.

S Krupa Shankar
0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
LVL 8

Expert Comment

by:glass_cookie
ID: 6859222
Hi!

For an EMPTY database file (ie. Access 97), it takes up about 68 KB, just that the data is very organised and retrieving them.  So, in terms of disk space, it takes up more but in terms of speed, it's quite fast.  There's overhead to consider, also.

For a text file, if the number of fields is small, it's no harm using as it can be fast if you have not many records.  The problem is that you can't create a relationship between the tables.  Maybe you could, if your program your app to recognise what is a relationship in a text file.  You'll also have to plan the layout of your textfile.

Using a text file can be troublesome as you'll as to plan more, program more.  If the programming is not very efficient, the time to load the data frorm the text file can be long, depending on the number of records.

Bottom line:  It's a tradeoff between disk space+overhead and programming time+planning.

That's it!

glass cookie : )

PS. Let me know where I'm not clear : )
0
 
LVL 3

Author Comment

by:shankarkrupa
ID: 6861608
hello glass cookie,

The records definitely are much more...they are in lakhs, so I gather it is not advisable to use textfiles?  Not only it means more records, but also more textfiles....

S Krupa Shankar
0
 
LVL 8

Expert Comment

by:glass_cookie
ID: 6863416
I suppose so : )

Use text files if you're storing data that's not much to you.  For lot's of data (ie. many, many records, fields, tables), use a database to handle that.  A database also contains backup/repair should a segment go corrupt : )  The thing about databases is that you should compact it from time to time so that it does not take up unwanted space.  Moreover, you can set a relationship between the tables, unlike text files.

As for me, I'll store my data in a text file only if they're in such a format (I do not have much to store normally):

Name
Address
Age
Tel. No
Name
Address
Age
Tel. No

Or

Name, Address, Age, Tel. No
Name, Address, Age, Tel. No

By seperating these fields into different text files as you've mentioned earlier on (if I've interpreted it correctly), should you lose one of the files, or should 1 file go corrupt due to a bug, your program may crash, or the data being mixed up.

That's it!

glass cookie ; )
0
 
LVL 3

Author Comment

by:shankarkrupa
ID: 6868607
So, there is no other way around?  Is it possible to get the name of tables from an Access database, as we do in oracle (select * from tab)?

I tried using "select * from msysobjects", but I got an error that it does not have read permission, though I can view it from the Ms Access application.

Getting the tables will help me some, though not fully....

S Krupa Shankar
0
 
LVL 3

Expert Comment

by:Bahnass
ID: 6869538
of course U can get table names
U EVEN CAN CREATE IT FROM SCrache

From Project -> references
Add ADOX Component

then

Public EXPConnection As New ADODB.Connection
Public EXPCatalog As New ADOX.Catalog
for i=0 to EXPCatalog.Tables.count -1
     debug.print EXPCatalog.Tables(i).name
next
0
 
LVL 3

Author Comment

by:shankarkrupa
ID: 6877350
Hello bahnass

I tried it, but I always get "0", and not the number of tables I have.  What could posisble be wrong when I say, msgbox expctalog.tables.count....?

S Krupa Shankar
0
 
LVL 3

Accepted Solution

by:
Bahnass earned 100 total points
ID: 6878560
Of Course My lines have  not opened connection

EXPConnection.Open "SomeValidConnection",....
set EXPCatalog.ActiveConnection =EXPConnection

0
 
LVL 3

Expert Comment

by:Bahnass
ID: 6884369
Thanks
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Excel object stays open 19 78
Excel - Save a copy of work book 13 88
VBA: Select SQL query based on a config Sheet v2 11 49
Advice in Xamarin 21 96
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

790 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question