UserForm updating a 2nd UserForm? 
Author Message
 UserForm updating a 2nd UserForm?

Hello,
I have two User Forms. The 2nd is opened from a button on the 1st form. I
want to populate data entered on the 2nd form into a text field on the 1st
form.

However, as soon as I unload the 2nd form, the 1st form (updated with the
right information) reverts back to its previous state, as if being
reinitialized with its default field values.

Can anyone PLEASE help me with this?
Thanks
Tony.



Sun, 21 Sep 2003 03:40:31 GMT  
 UserForm updating a 2nd UserForm?
Tony

This shouldn't be a problem.

Please supply some more info:
- Word version
- What do you do with the first userform when displaying the second
- How do you activate/show the first userform when the second is unloaded

--
/Anna Bohman
Bra Utbildning AB, Sweden

-------------------------------------------------------------------------


Quote:
> Hello,
> I have two User Forms. The 2nd is opened from a button on the 1st form. I
> want to populate data entered on the 2nd form into a text field on the 1st
> form.

> However, as soon as I unload the 2nd form, the 1st form (updated with the
> right information) reverts back to its previous state, as if being
> reinitialized with its default field values.

> Can anyone PLEASE help me with this?
> Thanks
> Tony.



Sun, 21 Sep 2003 06:38:31 GMT  
 UserForm updating a 2nd UserForm?
Hi Tony,

you probably have some code in the userform_activate event of the first
userform that sets the text in the field.

in this activate event try something like this

private sub userform_activate
    static allreadyactivated as boolean
    if allreadyactivated then exit sub
    'other existing code goes here
    allreadyactivated=true
end sub

if this doesn't help, post back with more specifics and code please

greetings, pieter.


Quote:
> Hello,
> I have two User Forms. The 2nd is opened from a button on the 1st form. I
> want to populate data entered on the 2nd form into a text field on the 1st
> form.

> However, as soon as I unload the 2nd form, the 1st form (updated with the
> right information) reverts back to its previous state, as if being
> reinitialized with its default field values.

> Can anyone PLEASE help me with this?
> Thanks
> Tony.



Mon, 22 Sep 2003 04:52:46 GMT  
 UserForm updating a 2nd UserForm?
Excellent. This worked great. I had no idea that the original Form would be
"activited" again since it was not explicitly unloaded.

Thanks again.
Tony.


Quote:
> Hi Tony,

> you probably have some code in the userform_activate event of the first
> userform that sets the text in the field.

> in this activate event try something like this

> private sub userform_activate
>     static allreadyactivated as boolean
>     if allreadyactivated then exit sub
>     'other existing code goes here
>     allreadyactivated=true
> end sub

> if this doesn't help, post back with more specifics and code please

> greetings, pieter.



> > Hello,
> > I have two User Forms. The 2nd is opened from a button on the 1st form.
I
> > want to populate data entered on the 2nd form into a text field on the
1st
> > form.

> > However, as soon as I unload the 2nd form, the 1st form (updated with
the
> > right information) reverts back to its previous state, as if being
> > reinitialized with its default field values.

> > Can anyone PLEASE help me with this?
> > Thanks
> > Tony.



Sat, 27 Sep 2003 06:29:29 GMT  
 UserForm updating a 2nd UserForm?
If you really mean activate as opposed to formload, activate has nothing to
do with loading or unloading. It is the act of bringing it to top and giving
it focus. Load and Unload actually relate to the form object itself and its
state in memory. While a by-product of unloading is that the form
disappears, this is not the same as deactivating.

To recap activation refers to the window state, loading/unloading refers to
the state of the form object in memory.

Pete
--


Quote:
> Excellent. This worked great. I had no idea that the original Form would
be
> "activited" again since it was not explicitly unloaded.

> Thanks again.
> Tony.



> > Hi Tony,

> > you probably have some code in the userform_activate event of the first
> > userform that sets the text in the field.

> > in this activate event try something like this

> > private sub userform_activate
> >     static allreadyactivated as boolean
> >     if allreadyactivated then exit sub
> >     'other existing code goes here
> >     allreadyactivated=true
> > end sub

> > if this doesn't help, post back with more specifics and code please

> > greetings, pieter.



> > > Hello,
> > > I have two User Forms. The 2nd is opened from a button on the 1st
form.
> I
> > > want to populate data entered on the 2nd form into a text field on the
> 1st
> > > form.

> > > However, as soon as I unload the 2nd form, the 1st form (updated with
> the
> > > right information) reverts back to its previous state, as if being
> > > reinitialized with its default field values.

> > > Can anyone PLEASE help me with this?
> > > Thanks
> > > Tony.



Sat, 04 Oct 2003 13:10:33 GMT  
 UserForm updating a 2nd UserForm?
Can I jump in here with a question?

We have an application which relys upon reactivation of the first userform
when the second one is unloaded. Works fine in Word97, but not in Word2000.
Has anyone any experience of how to force reactivation? We have tried hiding
and then reshowing form 1 but our client complains this creates a visible
flash which he objects to.

Also which of the two Words is doing the 'right' thing? We will have to
rewrite if it isn't just a bug in Word 2000.

Any help would be appreciated.
Cheers

Anna

Quote:




Quote:
> If you really mean activate as opposed to formload, activate has nothing
to
> do with loading or unloading. It is the act of bringing it to top and
giving
> it focus. Load and Unload actually relate to the form object itself and
its
> state in memory. While a by-product of unloading is that the form
> disappears, this is not the same as deactivating.

> To recap activation refers to the window state, loading/unloading refers
to
> the state of the form object in memory.

> Pete
> --



> > Excellent. This worked great. I had no idea that the original Form would
> be
> > "activited" again since it was not explicitly unloaded.

> > Thanks again.
> > Tony.



> > > Hi Tony,

> > > you probably have some code in the userform_activate event of the
first
> > > userform that sets the text in the field.

> > > in this activate event try something like this

> > > private sub userform_activate
> > >     static allreadyactivated as boolean
> > >     if allreadyactivated then exit sub
> > >     'other existing code goes here
> > >     allreadyactivated=true
> > > end sub

> > > if this doesn't help, post back with more specifics and code please

> > > greetings, pieter.



> > > > Hello,
> > > > I have two User Forms. The 2nd is opened from a button on the 1st
> form.
> > I
> > > > want to populate data entered on the 2nd form into a text field on
the
> > 1st
> > > > form.

> > > > However, as soon as I unload the 2nd form, the 1st form (updated
with
> > the
> > > > right information) reverts back to its previous state, as if being
> > > > reinitialized with its default field values.

> > > > Can anyone PLEASE help me with this?
> > > > Thanks
> > > > Tony.



Tue, 28 Oct 2003 06:59:01 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. UserForm updating a 2nd UserForm?

2. Variable(s) Reset by Showing 2nd UserForm on top 1st UserForm

3. UserForm To UserForm

4. Displaying Another UserForm when click on CheckBox in UserForm

5. Passing a Variable from one Userform to another Userform

6. Userform Properties not available in MSForms.Userform

7. VBProject / VBComponent [DYNAMIC Userform called from a STATIC Userform]

8. UserForm or not to UserForm?

9. UserForm events and moving a UserForm

10. Opening userforms from other userforms


 
Powered by phpBB® Forum Software © phpBB Group