TIP: Click on subject to list as thread! ANSI
echo: paradox
to: PETER READER
from: LANCE LEONARD
date: 1995-05-27 16:46:00
subject: Forms and datamodels

Peter,
 
 PR> I have a complex form linked to a multi-table datamodel.  I want to use
 PR> a command button to open a second dialog box to edit fields from a
 PR> second table linked 1 to 1 to my master table.  
You're right; this is a common need and here are many different ways to solve 
it.  The one you cited works, but may not be the most, ah, optimal solution.  
Basically, you need to synchronize the two forms.  Best way to do this is to 
attach a UIObject variable to a bound field on the second form (using the 
form variable variation of the uiObject.attach() method) and then use the 
UIObject locate methods to synch the records accordingly.  For example,
 
   detForm.open( "DETAIL" )
   uiTargt.attach( detForm, someBoundObject )
   uiTarget.locate( fieldValueOnFirstForm.Value )
 
If you have 4.5, take a look at the Edit Customer button on the MASTORD form 
in the DIVEPLAN directory.  While the entire application may not be useful, 
MASTORD has some helpful bits of code.
 
You can also use setRange or setGenFilter to restrict the second form to the 
record being displayed on the first.
 
As I said, there are several different approaches.
 
Hope this helps...
 
-- Lance
--- Maximus 2.02
---------------
* Origin: Mountain Retreat (1:216/506)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.