1

Topic: I can not update the total from the subordinate form

In general there is in the subordinate form a total field, in the remark. At update of the data of the subordinate form the field in the parent form is updated, here all works.
But I have a button on the parent form at which earlier gated in values boot, values boot, but here in any way it is not possible to receive the total thus. What to do?

2

Re: I can not update the total from the subordinate form

Show the code on the button. If the loaded values in the subform , and the total does not change, it is possible to fulfill method Recalc of the principal form.

3

Re: I can not update the total from the subordinate form

Anatoly (Kiev);

DoCmd. OpenQuery "TovarClearUpPrihod", acNormal, acEdit
DoCmd. OpenQuery "PrihodUpTovar", acNormal, acEdit
Me. Recalc
Me. Requery
Me. Refresh
Me. SS = Me.ïîä÷èíåííàÿ_ôîðìà_TovatTemp.Form.sSum

4

Re: I can not update the total from the subordinate form

antipod;
You show the problem form and the necessary tables (therefore as from the code I  did not understand-at than here requests and search Recalc, Requery, Refresh impresses) is better

5

Re: I can not update the total from the subordinate form

Me. SS = Me._TovatTemp. Form.sSum

you want to appropriate to a normal field value of a calculated field. But at the moment of performance of this action can be not completed not only calculation, but also Requery (by the way, Recalc and Refresh here superfluous).
If Me. SS - a free field (sv-in "data" empty) make its calculated, specifying the link in the field sSum subforms.
If Me. SS it is connected to a field of a source and it is necessary to save result the total should be counted in a cycle on records RecordsetClone of the subform

6

Re: I can not update the total from the subordinate form

sdku;
And how the problem form to show?
The code idle time, requests change the forms given to the subordinate,   I wrote as I do not know why the data is not updated.
The last line should transfer from the subordinate form the total from the form remark to the main, returns Null similar.

7

Re: I can not update the total from the subordinate form

Anatoly (Kiev);
ssum, the calculated field, is equal to the total of other field.

8

Re: I can not update the total from the subordinate form

antipod;
Create new basis, import to it all objects, which concern the form (tables, requests) check up and lay out here (if the form on request the data of several tables if you use the given 1 tables it and should be a source (by the way, and request that updated) as a rule are used. Really basis such huge? The button> control> to compress and recover office>  the archiver (I hope not -2013- not than). be laid down in 150 Kb. Fill out a name of the problem form and as you represent its operation.

9

Re: I can not update the total from the subordinate form

sdku, here basis, the form arrival, at pushing the button "to load the old data" works two requests one erases the data in the table the goods, the second transfers their their tables prihod to the goods, and there should be a summation of the imported data that does not happen

10

Re: I can not update the total from the subordinate form

antipod wrote:

sdku, here basis, the form arrival...

such form is not present in the enclosed. State the task facing you, surrenders to me that all is easier, than you try to make (correctly and full certain/delivered task-50-90 of % of success-have it in view of)

11

Re: I can not update the total from the subordinate form

sdku, Prihod such form, the task is simple - it is necessary to load from tables earlier gated in values in the table the goods, it is all works that after loading total lines of the subordinate form would be displayed on the principal.

12

Re: I can not update the total from the subordinate form

antipod;
More shortly look at it (objects with a prefix "" and it is simple "N"), and to produce tables dataful which already is in basis (except archives) I consider not as absolutely correct

13

Re: I can not update the total from the subordinate form

sdku;
My case is not present, at you the report with a total field, at me the form, as a whole it works. The form is necessary what the user could to change transient data including additional fields of type of a tick on to select, on another never did.
The question idle time like - why me.reqwery does not change a field sSum=sum (Total) of the remark of the subordinate form, it and remains , even after update of the data of the form.

14

Re: I can not update the total from the subordinate form

antipod;
Still, null produces only in this procedure, I put the separate button on total obtaining on the principal form - result all normally - total

15

Re: I can not update the total from the subordinate form

sdku;
Besides - all is similar because procedure fulfills faster than there is an update of the data of the form if on the button to push the second time, the total of type the correct gets. But it is not true, if selects other day or other supplier that the total to be displayed old instead of new.

16

Re: I can not update the total from the subordinate form

1. In sv-ve "the Given" fields "SS" the principal form specify: = [__TovatTemp]! [sSum]
In the code comment out all places where to it field value sSum is appropriated.
2. You do Requery the principal (untied) form, and it is necessary subforms.
3. You use DoCmd. OpenQuery. You arranges, what 4 messages take off?
Replace the code resulted by you such:

CurrentDb. Execute "TovarClearUpPrihod"
CurrentDb. Execute "PrihodUpTovar"
Me.__TovatTemp.Form.Requery

4. In title of units misses Option Explicit (mandatory check of the code). It is bad.
Specify it in all titles and on the future in Tools-Options install the necessary flag.

17

Re: I can not update the total from the subordinate form

Anatoly (Kiev);
Thanks work.
About CurrentDb. Execute to me  DoCmd questions are disconnected in parameters , but they are convenient at debugging.