I had this problem and came up with a slightly different fix:
In the form that submits the data, I get the next record number, which is 
the primary key for the table  (I use a separate table to generate the next 
id for each table - because in the old days you couldn't count on SQL 
server's identity column).
  And pass that in a hidden field.
  This way, when I process the form, I already have the primary key.  I 
check if the key was used already. If it was, I update the record, if it 
isn't, I insert the record. This way the form handler can also be used to 
for an edit form also.
I update the form if the key is there because some people hit the back 
button, make a correction, then submit it again and expect that it will be 
updated.

If the user doesn't submit the form, I only wasted a record number, but it 
doesn't waste space, because no record was inserted. The net effect is that 
the record numbers in the table are not consecutive (there are gaps where 
people load the form, but don't submit it). No harm done, and it also lets 
me see how many people get to the form but don't submit it.

Al Musella
world wide websites
a1webs.com


I use a hidden

At 11:34 AM 5/11/2000 +1200, you wrote:

>In the form that submits the data we stored a hidden field which contained 
>the record count before insertion. If the recordcount was correct, it 
>inserted, otherwise it didn't.


------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to