Parent form cleared when EIP child browse 
Author Message
 Parent form cleared when EIP child browse

When inserting a parent record, how can I stop the parent's fields
getting cleared when inserting child records with EIP browse on the same
form?

I'm using C4 and ABC templates.  There is 2 files with an one-to-many
relation on one field (with AutoInc on parent).

The parent update and EIP child browse are on the same form.  After
entering values in the parent's fields, start inserting records in child
browse.  When tab is pressed at last field (to create next child record)
all the parent's fields are cleared except for the keyfield.  How do I
keep the parent's field values on the screen until OK/CANCEL pressed?

Madelyn



Sun, 28 Sep 2003 17:52:19 GMT  
 Parent form cleared when EIP child browse
When inserting a parent record, how can I stop the parent's fields
getting cleared when inserting child records with EIP browse on the same

form?

I'm using C4 and ABC templates.  There is 2 files with an one-to-many
relation on one field (with AutoInc on parent).

The parent update and EIP child browse are on the same form.  After
entering values in the parent's fields, start inserting records in child

browse.  When tab is pressed at last field (to create next child record)

all the parent's fields are cleared except for the keyfield.  How do I
keep the parent's field values on the screen until OK/CANCEL pressed?

Madelyn



Sun, 28 Sep 2003 17:57:23 GMT  
 Parent form cleared when EIP child browse
Madelyn,

Maybe someone will come up with a good solution here, but I finally gave up
and now just hide the child tab on Insert which requires a save of the
parent records before any child records can be added.  I suppose the same
thing could be accomplished with a "Save Parent" button on the form that
would both save it and unhide the child tab, but I've not tried it.
--
Louis Andrews - C5ee ABC


Quote:
> When inserting a parent record, how can I stop the parent's fields
> getting cleared when inserting child records with EIP browse on the same

> form?

> I'm using C4 and ABC templates.  There is 2 files with an one-to-many
> relation on one field (with AutoInc on parent).

> The parent update and EIP child browse are on the same form.  After
> entering values in the parent's fields, start inserting records in child

> browse.  When tab is pressed at last field (to create next child record)

> all the parent's fields are cleared except for the keyfield.  How do I
> keep the parent's field values on the screen until OK/CANCEL pressed?

> Madelyn



Sun, 28 Sep 2003 20:53:32 GMT  
 Parent form cleared when EIP child browse
Madelyn,

Do you have fields from the parent that you are range limiting the child
browse with as hot fields of the child browse? You should never have range
limit fields, either local/global variables or other files, as hot fields in
the browse where the limits are applied. They can get cleared quit easily
which destroys your range limit.

HTH,

Rick Martin
Sharpe Software, Inc.


Quote:
> When inserting a parent record, how can I stop the parent's fields
> getting cleared when inserting child records with EIP browse on the same

> form?

> I'm using C4 and ABC templates.  There is 2 files with an one-to-many
> relation on one field (with AutoInc on parent).

> The parent update and EIP child browse are on the same form.  After
> entering values in the parent's fields, start inserting records in child

> browse.  When tab is pressed at last field (to create next child record)

> all the parent's fields are cleared except for the keyfield.  How do I
> keep the parent's field values on the screen until OK/CANCEL pressed?

> Madelyn



Sun, 28 Sep 2003 23:26:53 GMT  
 Parent form cleared when EIP child browse
Also, check my kb for "parent." The buffer needs to be saved/restored.

--

Steve Parker
[Team Topspeed - Internet Connect]

-------------------------------------------------------------
Knowledge base: www.par2.com/cws/c5launch.dll/faqs/thefaqs.exe.0
Download center: www.par2.com/cws/c5launch.dll/d7.exe.0
--------------------------------------------------------------


Quote:
> Madelyn,

> Maybe someone will come up with a good solution here, but I finally gave
up
> and now just hide the child tab on Insert which requires a save of the
> parent records before any child records can be added.  I suppose the same
> thing could be accomplished with a "Save Parent" button on the form that
> would both save it and unhide the child tab, but I've not tried it.
> --
> Louis Andrews - C5ee ABC



> > When inserting a parent record, how can I stop the parent's fields
> > getting cleared when inserting child records with EIP browse on the same

> > form?

> > I'm using C4 and ABC templates.  There is 2 files with an one-to-many
> > relation on one field (with AutoInc on parent).

> > The parent update and EIP child browse are on the same form.  After
> > entering values in the parent's fields, start inserting records in child

> > browse.  When tab is pressed at last field (to create next child record)

> > all the parent's fields are cleared except for the keyfield.  How do I
> > keep the parent's field values on the screen until OK/CANCEL pressed?

> > Madelyn



Mon, 29 Sep 2003 00:36:58 GMT  
 Parent form cleared when EIP child browse
Thanks.  I get "The Requested Program did not Execute" message.

Icetips has the following from Jerry Norman that uses a button like I
suggested should work, but have never done.  This is for C4, but I imagine
it should work in later versions with ABC.  I gather the "EnableChildren" is
a routine to unhide any child tabs that were hidden on access with Insert.
I don't understand the part about "I re-enable btApply button if a field
value in the primary record is changed."  How does you easily check to see
if any field value in the primary record is changed?

--
Louis Andrews - C5ee ABC
------------------------
Lee, I'm jumping in here without seeing your initial post so this may be
wide of the mark. I code an Apply button in my apps as a way to save the
record and enable the child record tabs (i.e., the child tabs are disabled
until the parent is saved). I am using C4 ABC. Here's the code in the Apply
button's Accept embed:

 Case Self.Request
 Of ChangeRecord
   Access:business.Update()
 Of InsertRecord
   If Not Access:Business.Insert()
     Self.Request = ChangeRecord
     Do EnableChildren
   Else
     Cycle
   End
 End
 SELF.Saved = SELF.Primary.Me.SaveBuffer()
 ?btApply{Prop:Disable}=True

I re-enable btApply button if a field value in the primary record is
changed.

HTH.
-------------------------


Quote:
> Also, check my kb for "parent." The buffer needs to be saved/restored.

> --

> Steve Parker
> [Team Topspeed - Internet Connect]

> -------------------------------------------------------------
> Knowledge base: www.par2.com/cws/c5launch.dll/faqs/thefaqs.exe.0
> Download center: www.par2.com/cws/c5launch.dll/d7.exe.0
> --------------------------------------------------------------



> > Madelyn,

> > Maybe someone will come up with a good solution here, but I finally gave
> up
> > and now just hide the child tab on Insert which requires a save of the
> > parent records before any child records can be added.  I suppose the
same
> > thing could be accomplished with a "Save Parent" button on the form that
> > would both save it and unhide the child tab, but I've not tried it.
> > --
> > Louis Andrews - C5ee ABC



> > > When inserting a parent record, how can I stop the parent's fields
> > > getting cleared when inserting child records with EIP browse on the
same

> > > form?

> > > I'm using C4 and ABC templates.  There is 2 files with an one-to-many
> > > relation on one field (with AutoInc on parent).

> > > The parent update and EIP child browse are on the same form.  After
> > > entering values in the parent's fields, start inserting records in
child

> > > browse.  When tab is pressed at last field (to create next child
record)

> > > all the parent's fields are cleared except for the keyfield.  How do I
> > > keep the parent's field values on the screen until OK/CANCEL pressed?

> > > Madelyn



Mon, 29 Sep 2003 01:07:16 GMT  
 Parent form cleared when EIP child browse
Hmmm. Working fine from here.

--

Steve Parker
[Team Topspeed - Internet Connect]

-------------------------------------------------------------
Knowledge base: www.par2.com/cws/c5launch.dll/faqs/thefaqs.exe.0
Download center: www.par2.com/cws/c5launch.dll/d7.exe.0
--------------------------------------------------------------


Quote:
> Also, check my kb for "parent." The buffer needs to be saved/restored.

> --

> Steve Parker
> [Team Topspeed - Internet Connect]

> -------------------------------------------------------------
> Knowledge base: www.par2.com/cws/c5launch.dll/faqs/thefaqs.exe.0
> Download center: www.par2.com/cws/c5launch.dll/d7.exe.0
> --------------------------------------------------------------



> > Madelyn,

> > Maybe someone will come up with a good solution here, but I finally gave
> up
> > and now just hide the child tab on Insert which requires a save of the
> > parent records before any child records can be added.  I suppose the
same
> > thing could be accomplished with a "Save Parent" button on the form that
> > would both save it and unhide the child tab, but I've not tried it.
> > --
> > Louis Andrews - C5ee ABC



> > > When inserting a parent record, how can I stop the parent's fields
> > > getting cleared when inserting child records with EIP browse on the
same

> > > form?

> > > I'm using C4 and ABC templates.  There is 2 files with an one-to-many
> > > relation on one field (with AutoInc on parent).

> > > The parent update and EIP child browse are on the same form.  After
> > > entering values in the parent's fields, start inserting records in
child

> > > browse.  When tab is pressed at last field (to create next child
record)

> > > all the parent's fields are cleared except for the keyfield.  How do I
> > > keep the parent's field values on the screen until OK/CANCEL pressed?

> > > Madelyn



Mon, 29 Sep 2003 01:54:26 GMT  
 Parent form cleared when EIP child browse
I've slightly revised Jerry Norman's approach to solving the lost parent
data problem that sometimes occurs with child file access on insert.  This
seems to work fine and because the buttons are put on top of each other the
window looks better than my previous version.  My thanks to Jerry.
--------------------------------------------------------------------
Hiding Tabs and Buttons temporarily on Insert to prevent lost data in parent
file

Embed: Local Objects-ThisWindow-Windowmanager: Ask Procedure (1,800)
!Code to hide Hides secondary tabs and buttons on enter of new title to---
!prevent orphans if child records are filled on
Insert.--------------------------
IF SELF.Request = InsertRecord            !If adding a record
       ?Tab:4{Prop:Hide} = True              !Hide the Authors (a M:M Child
link Tab
       ?OKButton{Prop:Hide} = True       !Hide the OK Button
ELSE
       ?ButtonApply{Prop:Hide}=True      !If not Insert hide the Apply
Button
END                                                         !Endif
!EndCode--------------------------------------------------------------------
------------

Embed: Local Objects - ?ButtonApply Accepted (5,000)  Also put it in the
same place for the ?OKButton
!Code to allow parent and child entry without loosing parent record----
Case Self.Request
Of ChangeRecord
   Access:Titles.Update()
Of InsertRecord
   If Not Access:Titles.Insert()
     Self.Request = ChangeRecord         !Edit if not Insert
     ?Tab:4{Prop:Hide} = False             !UnHide the Authors Tab
Else
     Cycle
  End                                                       !End If Not
Access
End                                                         !End Case
Statement
SELF.Saved = SELF.Primary.Me.SaveBuffer()
?ButtonApply{Prop:Hide}=True                !Hide the Apply Button
?OKButton{Prop:Hide}=False                    !Unhide the OK Button
ThisWindow.ReSet(1)                                !Apply changes
!EndCode--------------------------------------------------------------------
------

Put the Apply Button you create over the OK button.  Make their position the
same in the window (.) definition window.  The Apply button will appear and
be active during the Insert phase for the parent and they the OK button will
take over.  On Change, the OK button will be the active button.  If you
don't chose to add one or more child records on Insert, you should click the
OK button to close and save the parent record.
--
Louis Andrews - C5ee ABC


Quote:
> Thanks.  I get "The Requested Program did not Execute" message.

> Icetips has the following from Jerry Norman that uses a button like I
> suggested should work, but have never done.  This is for C4, but I imagine
> it should work in later versions with ABC.  I gather the "EnableChildren"
is
> a routine to unhide any child tabs that were hidden on access with Insert.
> I don't understand the part about "I re-enable btApply button if a field
> value in the primary record is changed."  How does you easily check to see
> if any field value in the primary record is changed?

> --
> Louis Andrews - C5ee ABC
> ------------------------
> Lee, I'm jumping in here without seeing your initial post so this may be
> wide of the mark. I code an Apply button in my apps as a way to save the
> record and enable the child record tabs (i.e., the child tabs are disabled
> until the parent is saved). I am using C4 ABC. Here's the code in the
Apply
> button's Accept embed:

>  Case Self.Request
>  Of ChangeRecord
>    Access:business.Update()
>  Of InsertRecord
>    If Not Access:Business.Insert()
>      Self.Request = ChangeRecord
>      Do EnableChildren
>    Else
>      Cycle
>    End
>  End
>  SELF.Saved = SELF.Primary.Me.SaveBuffer()
>  ?btApply{Prop:Disable}=True

> I re-enable btApply button if a field value in the primary record is
> changed.

> HTH.
> -------------------------



> > Also, check my kb for "parent." The buffer needs to be saved/restored.

> > --

> > Steve Parker
> > [Team Topspeed - Internet Connect]

> > -------------------------------------------------------------
> > Knowledge base: www.par2.com/cws/c5launch.dll/faqs/thefaqs.exe.0
> > Download center: www.par2.com/cws/c5launch.dll/d7.exe.0
> > --------------------------------------------------------------



> > > Madelyn,

> > > Maybe someone will come up with a good solution here, but I finally
gave
> > up
> > > and now just hide the child tab on Insert which requires a save of the
> > > parent records before any child records can be added.  I suppose the
> same
> > > thing could be accomplished with a "Save Parent" button on the form
that
> > > would both save it and unhide the child tab, but I've not tried it.
> > > --
> > > Louis Andrews - C5ee ABC



> > > > When inserting a parent record, how can I stop the parent's fields
> > > > getting cleared when inserting child records with EIP browse on the
> same

> > > > form?

> > > > I'm using C4 and ABC templates.  There is 2 files with an
one-to-many
> > > > relation on one field (with AutoInc on parent).

> > > > The parent update and EIP child browse are on the same form.  After
> > > > entering values in the parent's fields, start inserting records in
> child

> > > > browse.  When tab is pressed at last field (to create next child
> record)

> > > > all the parent's fields are cleared except for the keyfield.  How do
I
> > > > keep the parent's field values on the screen until OK/CANCEL
pressed?

> > > > Madelyn



Wed, 01 Oct 2003 05:12:16 GMT  
 Parent form cleared when EIP child browse
Thanks.  It looks good now.

Madelyn

Quote:

> I've slightly revised Jerry Norman's approach to solving the lost parent
> data problem that sometimes occurs with child file access on insert.  This
> seems to work fine and because the buttons are put on top of each other the
> window looks better than my previous version.  My thanks to Jerry.
> --------------------------------------------------------------------
> Hiding Tabs and Buttons temporarily on Insert to prevent lost data in parent
> file

> Embed: Local Objects-ThisWindow-Windowmanager: Ask Procedure (1,800)
> !Code to hide Hides secondary tabs and buttons on enter of new title to---
> !prevent orphans if child records are filled on
> Insert.--------------------------
> IF SELF.Request = InsertRecord            !If adding a record
>        ?Tab:4{Prop:Hide} = True              !Hide the Authors (a M:M Child
> link Tab
>        ?OKButton{Prop:Hide} = True       !Hide the OK Button
> ELSE
>        ?ButtonApply{Prop:Hide}=True      !If not Insert hide the Apply
> Button
> END                                                         !Endif
> !EndCode--------------------------------------------------------------------
> ------------

> Embed: Local Objects - ?ButtonApply Accepted (5,000)  Also put it in the
> same place for the ?OKButton
> !Code to allow parent and child entry without loosing parent record----
> Case Self.Request
> Of ChangeRecord
>    Access:Titles.Update()
> Of InsertRecord
>    If Not Access:Titles.Insert()
>      Self.Request = ChangeRecord         !Edit if not Insert
>      ?Tab:4{Prop:Hide} = False             !UnHide the Authors Tab
> Else
>      Cycle
>   End                                                       !End If Not
> Access
> End                                                         !End Case
> Statement
> SELF.Saved = SELF.Primary.Me.SaveBuffer()
> ?ButtonApply{Prop:Hide}=True                !Hide the Apply Button
> ?OKButton{Prop:Hide}=False                    !Unhide the OK Button
> ThisWindow.ReSet(1)                                !Apply changes
> !EndCode--------------------------------------------------------------------
> ------

> Put the Apply Button you create over the OK button.  Make their position the
> same in the window (.) definition window.  The Apply button will appear and
> be active during the Insert phase for the parent and they the OK button will
> take over.  On Change, the OK button will be the active button.  If you
> don't chose to add one or more child records on Insert, you should click the
> OK button to close and save the parent record.
> --
> Louis Andrews - C5ee ABC



> > Thanks.  I get "The Requested Program did not Execute" message.

> > Icetips has the following from Jerry Norman that uses a button like I
> > suggested should work, but have never done.  This is for C4, but I imagine
> > it should work in later versions with ABC.  I gather the "EnableChildren"
> is
> > a routine to unhide any child tabs that were hidden on access with Insert.
> > I don't understand the part about "I re-enable btApply button if a field
> > value in the primary record is changed."  How does you easily check to see
> > if any field value in the primary record is changed?

> > --
> > Louis Andrews - C5ee ABC
> > ------------------------
> > Lee, I'm jumping in here without seeing your initial post so this may be
> > wide of the mark. I code an Apply button in my apps as a way to save the
> > record and enable the child record tabs (i.e., the child tabs are disabled
> > until the parent is saved). I am using C4 ABC. Here's the code in the
> Apply
> > button's Accept embed:

> >  Case Self.Request
> >  Of ChangeRecord
> >    Access:business.Update()
> >  Of InsertRecord
> >    If Not Access:Business.Insert()
> >      Self.Request = ChangeRecord
> >      Do EnableChildren
> >    Else
> >      Cycle
> >    End
> >  End
> >  SELF.Saved = SELF.Primary.Me.SaveBuffer()
> >  ?btApply{Prop:Disable}=True

> > I re-enable btApply button if a field value in the primary record is
> > changed.

> > HTH.
> > -------------------------



> > > Also, check my kb for "parent." The buffer needs to be saved/restored.

> > > --

> > > Steve Parker
> > > [Team Topspeed - Internet Connect]

> > > -------------------------------------------------------------
> > > Knowledge base: www.par2.com/cws/c5launch.dll/faqs/thefaqs.exe.0
> > > Download center: www.par2.com/cws/c5launch.dll/d7.exe.0
> > > --------------------------------------------------------------



> > > > Madelyn,

> > > > Maybe someone will come up with a good solution here, but I finally
> gave
> > > up
> > > > and now just hide the child tab on Insert which requires a save of the
> > > > parent records before any child records can be added.  I suppose the
> > same
> > > > thing could be accomplished with a "Save Parent" button on the form
> that
> > > > would both save it and unhide the child tab, but I've not tried it.
> > > > --
> > > > Louis Andrews - C5ee ABC



> > > > > When inserting a parent record, how can I stop the parent's fields
> > > > > getting cleared when inserting child records with EIP browse on the
> > same

> > > > > form?

> > > > > I'm using C4 and ABC templates.  There is 2 files with an
> one-to-many
> > > > > relation on one field (with AutoInc on parent).

> > > > > The parent update and EIP child browse are on the same form.  After
> > > > > entering values in the parent's fields, start inserting records in
> > child

> > > > > browse.  When tab is pressed at last field (to create next child
> > record)

> > > > > all the parent's fields are cleared except for the keyfield.  How do
> I
> > > > > keep the parent's field values on the screen until OK/CANCEL
> pressed?

> > > > > Madelyn



Tue, 07 Oct 2003 17:41:16 GMT  
 
 [ 9 post ] 

 Relevant Pages 

1. EIP with Parent and Child Browse

2. Child browse in parent form

3. I have Update Form (parent file) with Browse List (child file)

4. How To restrict child browse to selected parent browse record

5. browse-form-browse and eip

6. refreshing browse box on form from parent browse

7. Adding child clears parent record

8. Child Field in EIP Browse

9. SQL - adding child record from parent form

10. Add Child Record Within New Parent Record form.

11. delete parent-child record without using form

12. Update of Parent Form from Child

 

 
Powered by phpBB® Forum Software