Wrox Programmer Forums
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 4th, 2007, 03:17 AM
Authorized User
 
Join Date: Jan 2007
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default Debits & Credits

I have a table that has debits and credits in two different columns along with other info.

there is one debit for each credit. in some cases though there is one debit and 2 or more credits that sum up that ammount.

the common thing that Debits and Credits have is a project number in a seperate column.. but this alone will bring me all the entries!

how can i finf these lines? i have tried all sort of queries but nothing works.. anyone can help... its one thing i didnt think of..

thanks guys in advance...



 
Old April 4th, 2007, 10:12 AM
Friend of Wrox
 
Join Date: Feb 2007
Posts: 163
Thanks: 0
Thanked 2 Times in 2 Posts
Default

If the project number has several debits and credits then that won't be an appropriate key. You need to somehow determine explicitly which credits belong to which Debits. For a record like this there would be no query that would separate them:
---------------------------------------
Project# Debit Credit
123 10.50 5.50
123 10.50 5.00
123 10.50 4.50
123 10.50 6.00
---------------------------------------

Implicitly we can determine there are two transactions here but without being able to determine this explicitly your code/database/form won't be able to differentiate between them. You need a field that will explicitly separate these in some way. Perhaps a date field, or a field that specifies an order number or invoice number that would be different between the two debits done for that project #. If you're sure the two debits will never be the same you COULD differentiate based on project number and the debit amount but this isn't a good assumption.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Javascript && keeps turnig into && ayrton Pro VB.NET 2002/2003 3 June 27th, 2005 03:34 PM
send & recive mails from exchange & lotus sever zaheersharief Pro VB 6 1 May 16th, 2005 06:55 AM
Linux & KDE & C++ & QT & MYSQL & Kdevelop Munnnki Linux 0 January 2nd, 2005 05:41 PM
XML from a DB recordset (removal of <>) Thodoris XML 3 July 13th, 2004 12:28 AM
sql & join tables & find a field in multiple table trangd Beginning PHP 2 January 29th, 2004 07:18 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.