Update Query to form unbound form fields (1 Viewer)

mba_110

Registered User.
Local time
Today, 03:49
Joined
Jan 20, 2015
Messages
280
Hi

As title labeled i am trying to update the query results which is sum of another query to a form fields, i did try in putting the reference to QrySumGenralEntry from control source of unbound text boxes something like
Code:
=[QrySumGeneralEntry]![SumOfCurDebit]
for all four fields but it doesn't work.

Then i am trying to do it with sql update query on form's Onchange event like

Code:
UPDATE QrySumGeneralEntry SET QrySumGeneralEntry.SumOfCurDebit = [Forms]![frmJournalEntry]![txtSumCurDebits], QrySumGeneralEntry.SumOfCurCredit = [Forms]![frmJournalEntry]![txtSumcurCredits], QrySumGeneralEntry.SumOfTotalDebit = [Forms]![frmJournalEntry]![txtSumTotalDebit], QrySumGeneralEntry.SumOfTotalCredit = [Forms]![frmJournalEntry]![txtSumTotalCredit];

Can you please help me getting that sumOf values in forms unbound boxes, their is no issues of Unique ID etc because in QrySumGeneralEntry will have only one row at time, which will be sum of mainform's selected ID.
 

June7

AWF VIP
Local time
Today, 02:49
Joined
Mar 9, 2014
Messages
5,463
Can't reference table or query object directly like that in textbox.

Usually no reason to save aggregate data and can actually be dangerous.

What happens when you run that UPDATE action?
 

mba_110

Registered User.
Local time
Today, 03:49
Joined
Jan 20, 2015
Messages
280
Its telling operation must use updatable query.

I need this totals on forms unbound text boxes.
 

June7

AWF VIP
Local time
Today, 02:49
Joined
Mar 9, 2014
Messages
5,463
Why are you updating a query instead of a table? If QrySumGeneralEntry is an aggregate query, definitely cannot UPDATE it.
 

mba_110

Registered User.
Local time
Today, 03:49
Joined
Jan 20, 2015
Messages
280
Thanks i make small mistake, ignore the forms footer and header.

Now i got it, no need of update query for this.

Thank you all.
 

Users who are viewing this thread

Top Bottom