Print Page | Close Window

ASP / HTML Form + Autonumber

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=22014
Printed Date: 29 March 2026 at 7:45pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: ASP / HTML Form + Autonumber
Posted By: MortiOli
Subject: ASP / HTML Form + Autonumber
Date Posted: 23 November 2006 at 8:16pm

Hi all,

I'm trying to create a form which, once filled in, submits it to the required email address, and into a database to record the submission.

I can achieve that, but I'd also like each form to have a unique ID, ie the AutoNumber in the database, and for that to be emailed to the address at the same time.

Does anyone have / know of any code to do this please?

For example, someone fills in form, they click submit, the details are entered into the DB, the AutoNumber is pulled back and all the details, with the AutoNumber are emailed to the person.

Any help would be greatly appreciated!

Thanks




Replies:
Posted By: dj air
Date Posted: 23 November 2006 at 8:20pm
insert the record  into the db

use the .requery feature

then .movelast

and newID = object("AutoNumber")

now send the email with the newID value enabled


Posted By: MortiOli
Date Posted: 23 November 2006 at 8:24pm

Sorry to sound cheeky, but do you have an example I could work from?

I'm not very clued up when it comes to ASP - really wish I was.


Posted By: dj air
Date Posted: 23 November 2006 at 8:28pm
take a look at the WWF register .asp file this uses this idea.

you need to set the cursor and lock types

that file does it all


Posted By: MortiOli
Date Posted: 23 November 2006 at 8:49pm
I worked through the below to try and understand the insert into the database, then email the form;
 
http://www.cgw3.co.uk/uploads/tutorials/InsertandEmail_demo.zip - http://www.cgw3.co.uk/uploads/tutorials/InsertandEmail_demo.zip
 
I think I'm way out of my depth with the retrieving the AutoNumber.
 
Thanks for your help anyway Aaron.


Posted By: dj air
Date Posted: 23 November 2006 at 9:49pm
thats ok, im me if you still need it



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net