Get ready for BLACK FRIDAY shopping starting in

Forums

This topic is locked

Immediately capture ID of submitted record & email

Posted 19 Jul 2002 22:51:02
1
has voted
19 Jul 2002 22:51:02 Mitchel Tendler posted:
Here's a good one.

I have my forms working perfectly, the last Form (step3) does 2 things automatically:

- Captures all the Form values (hidden one's also) and send's out a CDO e-mail
- Captures all the Form values (hidden one's also) and submits the record to the Access 2000 DB

What I'm trying to do now is not only e-mail all the contents of the Form, but also the ID# of the record just submitted to the DB. The ID# is your normal Autonumber field in Access.

Anyone know if this can be done?

Thanks!

Mitch

Replies

Replied 20 Jul 2002 07:04:19
20 Jul 2002 07:04:19 Dave Clarke replied:
i think there are a couple of extensions on here to do that, or maybe a tutorial, can't remember at min (just finished a night shift at work).
I haven't tried em so dont know if they work
Replied 20 Jul 2002 19:00:16
20 Jul 2002 19:00:16 aegis kleais replied:
I would do the following:

Suppose your page that does all this is called insert_data.asp

Setup the insert behavior to goto insert_data.asp?sent=yes after the insert has been performed. Now in your page, add the following data:

DATA BINDINGS
+ RECORDSET

name: rcdLastInsert
query: SELECT * from tblUsers ORDER BY fldTableIndex DESC

This will create a database who's first record will be the most previously inputed record.

Then in your ASP code, you can do something like:

<%
lastInsertIndex = rcdLastInsert.Fields.Item("fldTableIndex".Value
%>

Then just create a hidden text input and give it the value of <%= lastInsertIndex %>

It should then send the index of the last insert's INDEX value.

Hope this helps.

Aegis Kleais
New Media Web Developer
(DWMX : IIS5.1 : SQL2K : WXP : ASP[VB/JS])

Reply to this topic