no of records before save [message #403560] |
Sat, 16 May 2009 23:35 |
rzkhan
Messages: 370 Registered: March 2005
|
Senior Member |
|
|
I have a form with 4 blocks.
I am assigning the primay key value to a text item after exiting from 3rd block(on successful completion).
I want to create two records in 3rd block ONLY IF there are no existing records.
my question is.
How can i check the no of existing records in this block,
while the records have not been saved yet AND the primary key value is not also being assigned?
Riaz
|
|
|
Re: no of records before save [message #404498 is a reply to message #403560] |
Fri, 22 May 2009 00:36 |
|
djmartin
Messages: 10181 Registered: March 2005 Location: Surges Bay TAS Australia
|
Senior Member Account Moderator |
|
|
I suggest you rethink your logic.
The "usual" / "normal" / "works best most of the time" way to run a master/detail (and master/detail/sub-detail) form is to use the Forms wizards to create the 'blocks', create the 'relations', and for primary keyed records to use a when-create-record trigger on each lower block to carry across the key data from the higher level.
To keep the form simple I just let the database throw errors for me. If you want this to happen after each record then either set the block characteristics, or put a 'commit' statement in the 'post-record' trigger.
David
|
|
|