AfterUpdate double amount (1 Viewer)

ClaraBarton

Registered User.
Local time
Yesterday, 23:14
Joined
Oct 14, 2019
Messages
606
I’ve worked on this so long that I can no longer see the trees for the forest.

I want to transfer money from one account to another so (on your advice) I’ve created a self join table. Mostly this works except for when there is more than one transfer (bottom subform) in the Check.

The code on afterupdate in the Transfer subform places 2 amounts (one for each transfer) which makes the check amount double. How can I only place the total amount on the first transaction in the subform. Or am I way off base here?

Clicking on the split column on the far right of the opening form will call the Check Form where the subform with the transaction is. Thanks in advance for any help.
 

Attachments

The table named tblJunctionTransaction is not a "junction" table. Purpose of a junction table is to associate data of two other tables in a many-to-many relationship. What you have is simply a dependent table. What is purpose of this table?

However, tblCheckCat is a junction and I don't understand why TransactionID is saved there instead of CategoryID into tblTransactions.

Which table do you consider to be a "self-join"? I am not seeing one. A "self-join" example would be a table of Employees where there is a field to show each employee's supervisor which would be populated with EmployeeID from the same table. In order to see the associated supervisor details, a query would use a "self-join" of Employees table to the Supervisor field. Other examples are family tree and manufacturing/assembly. This type of data is recursive in nature and can be difficult to build. I don't see this in your model. What you have done is build an aggregate query for transactions then joined that query to qryTransaction and then unnecessarily included qryNames and used this as the RecordSource of form. Basing a form RecordSource on a query that is sourced by 3 other queries seems rather bizarre to me.

You have Debit and Credit in 3 tables, which makes no sense to me. You are duplicating money data into multiple tables.

Why use a query for sfcAccounts when you only display tblAccount fields? Just bind to table. Why is there AccTotal field? Account balances should be calculated, not saved in table. And then what is BankBalance field intended for?

Pretty much same question for popAccountDetail. Query as RecordSource is unnecessary. Bind to table.

If you are trying to build a double-entry bookkeeping app, why reinvent the wheel? Enough OTS apps (e.g. Quickbooks).

Will a transfer always involve issuing a check?
Describe the data entry steps to take that will replicate issue.

So exactly what is your app's purpose?
 
Last edited:

Users who are viewing this thread

Back
Top Bottom