1

Topic: Update of the subordinate form

On the principal form two subordinate forms 1 and 2. It is necessary to update the subordinate form 2 from the subordinate form 1.
Wrote in event "Current record" in shape 1:
Me. Parent. [The subordinate form 2].Form. Requery
At discovery of the principal form: "Entered expression contains the inadmissible reference to property ' Form/Report '"
And how correctly to write?

2

Re: Update of the subordinate form

nauf wrote:

On the principal form two subordinate forms 1 and 2. It is necessary to update the subordinate form 2 from the subordinate form 1.
Wrote in event "Current record" in shape 1:
Me. Parent. [The subordinate form 2].Form. Requery
At discovery of the principal form: "Entered expression contains the inadmissible reference to property ' Form/Report '"
And how correctly to write?

Yes it is easy.
Address to  as to a class
Form_.Requery

3

Re: Update of the subordinate form

Thanks!
Added the code "On Error Resume Next". Now works. It turns out not an error?

4

Re: Update of the subordinate form

wrote:

ROI, disgusting council

Than?

5

Re: Update of the subordinate form

nauf;
The error comes because event On Current comes earlier, than the principal form boots. Whether it is possible to fence, of course, a kitchen garden with check the form already is loaded and then to address to it, and it is possible, simply, to declare global flag for form ( - by default - ) and to deliver it in true on event OnLoad. And in procedure on current record, simply to check up that a flag not falseness

Dim flg As Boolean
...
Private Sub Form_Unload (Cancel As Integer)
....
Set flg = True
End Sub
Private Sub Form_Current ()
On Error GoTo err_Form_Current
If flg Then Me. Parent. [The subordinate form 2].Form. Requery
exit_Form_Current:
Exit Sub
err_Form_Current:
MsgBox Err. Description
Resume exit_Form_Current
End Sub

6

Re: Update of the subordinate form

Sorry;
Not Private Sub Form_Unload (Cancel As Integer), and

Private Sub Form_Load ()
....
Set flg = True
End Sub

7

Re: Update of the subordinate form

Declared global variable: dim flg as boolean
Swears on Set flg=true in event of "loading" of the principal form
"Compile error: Object required"

8

Re: Update of the subordinate form

In the principal form there is one code on "button click". In the subordinate form only Requery for for event Current.

9

Re: Update of the subordinate form

wrote:

it is passed...
Why not an error? Very much even the error also is connected it to sequence of loading of the principal and subordinate forms. If it is short, the subordinate form already reached event "Current record", and principal yet .
it is passed...
All

If you do not know how to cook and to work with classes it does not mean that all such.
Thanks for the torn answer.
Yours faithfully.

10

Re: Update of the subordinate form

wrote:

it is passed...
What to do (and sighed heavily) smile))

All right passed ( smiled victoriously ):-Q

11

Re: Update of the subordinate form

wrote:

it is passed...
Well into the account of the elementary things - it you got excited I (hope)
Yours faithfully.

12

Re: Update of the subordinate form

I, by the way, had suffered much because of calls to a form class in another's programs, always now them ruthlessly I alter on correct reversal through a collection of forms or object hierarchy of the form. Reversal to a form class I use only by development when laziness to climb to copy an exact title , and itellisence prompts. After debugging besides I alter.
Reversal through a class works correctly only for  windows and in the debugged program. Development errors are difficult diagnosed and sometimes conduct to unpredictable behavior

13

Re: Update of the subordinate form

MrShin wrote:

I, by the way, had suffered much because of calls to a form class in another's programs, always now them ruthlessly I alter on correct reversal through a collection of forms or object hierarchy of the form. Reversal to a form class I use only by development when laziness to climb to copy an exact title , and itellisence prompts. After debugging besides I alter.
Reversal through a class works correctly only for  windows and in the debugged program. Development errors are difficult diagnosed and sometimes conduct to unpredictable behavior

I read your judgement.
You do not love or (are not able) to work with classes
But it does not mean that classes it angrily.
And in what at you a problem with debugging of classes and their unpredictable behavior.
Yours faithfully.

14

Re: Update of the subordinate form

wrote:

As this implicit raising of a copy!

! Casually addressed to a class of the closed window and now this invisible window hangs, and you do not understand that generally happens
And I very much love classes

15

Re: Update of the subordinate form

wrote:

So that that who that is not able to work with classes, it is similar YOUR defect,
For you SUCH ALL  only as though show off that ostensibly are able,
BUT as it is necessary do not show.

Udobnenkaja a position.
Means, if that you do not know, not you are guilty that books do not read;
And somebody who not explained and have not chewed.
Here it as....

16

Re: Update of the subordinate form

wrote:

ROI, time the such went..., completely I will support the previous orator. Besides I will mark, if the form does not have unit you will not address to it. As this implicit raising of a copy! Here it generates many bugs. And if according to the logic of the program and not  in this place of the form to which address?
And now teach us to work with classes!
it is passed...
Also I will add. No, you did not hear, you invented. I widely use classes where it is necessary for me. And my natural modesty does not allow me to state that I comprehended all delights of operation with classes.
[youtube=pJEGkde1GXM]

.
If the form does not have unit it all the same is a class has properties and methods etc.
I did not speak that it is necessary to translate all to class level or on the contrary.
The HARDWARE was asked by a question "On the principal form two subordinate forms 1 and 2. It is necessary to update the subordinate form 2 from the subordinate form 1."
Here for this case I also gave an example.
So did not understand why you here became agitated.
On the principal form already there are forms 1 2 so-that, any implicit creation of a copy.
Yours faithfully.

17

Re: Update of the subordinate form

wrote:

it is passed...
So that that who that is not able to work with classes, it is similar YOUR defect for you SUCH ALL  only as though show off that ostensibly be able, BUT as it is necessary do not show.
Logically it turns out that you simply are engaged - in Slovobludstvom and it is simple similar what that and  excessively.
Neither an example as it is necessary, nor clear clarification, only the general words.
Fie 3 times, in a rating minus. - - -

Matter is not in .
I set an example for a specific case.
I not all am able, but which where classes are pleasant.
Also it is not necessary to spit on me.
I can  I will be useful.
Yours faithfully.:-Q

18

Re: Update of the subordinate form

hm-m-m wrote:

it is passed...
Udobnenkaja position.
Means, if that you do not know, not you are guilty that books do not read;
And somebody who not explained and have not chewed.
Here it as....

-Yes!
- at us such!
- Bright but kind!
Yours faithfully.

Posts [ 18 ]

Pages 1

You must login or register to post a reply