There are MANY ways to deal with this...so I'd search the archives or this thread will spin out of control ;-)
Personally this is what I do: 1) form submits to itself (naming form button "Task"...so when the form posts to itself you can check at the top of your file if FORM.Task IsDefined()....if defined.see step 2) 2) if submitted, the insert query runs (after form data is validated of course) 3) user is sent to a confirmation page via CFLOCATION So now if they refresh the page it's just the confirmation and not the form page which would re-insert the data as you're seeing now. HTH Cheers Bryan Stevenson B.Comm. VP & Director of E-Commerce Development Electric Edge Systems Group Inc. phone: 250.480.0642 fax: 250.480.1264 cell: 250.920.8830 e-mail: [EMAIL PROTECTED] web: www.electricedgesystems.com ----- Original Message ----- From: "Discover Antartica" <[EMAIL PROTECTED]> To: "CF-Talk" <cf-talk@houseoffusion.com> Sent: Wednesday, February 09, 2005 9:48 AM Subject: Refreshing the page gives problems > The form in the page is submitting to the same page. If the user refreshes > the page, then, the query to insert the record filled out in the form is > executed again. So, the number of records in the table keep increasing. > > is there a way to prevent this? > > The primary key in the table the data is being inserted is a counter that > increments itself. It is not part of the query that is inserting the new > records. > > merci! > > > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:193902 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54