CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> Archive -> CodeCharge.Discussion

 Retrieving a just-created record for editing

Print topic Send  topic

Author Message
JHoffman
Posted: 08/03/2001, 4:21 PM

OK, I've searched this board and the examples for a answer to this problem.
I've created a non-login signup form. Anyone can fill out the form then
submit it. I then want to bring that same info for the newly created record
into a new form for the user to check and confirm their entries.

Because I don't have a user ID being created by a login, how do I
immediately grab the automatically created Record_ID to recall that record's
fields into the next form? Is there a way to set a unique ID that I can put
into the db and transfer it to the next form as an input variable?

I'm using ASP and Access.

Thanks in advance for your .

Joe Hoffman

Alistair McFadyen
Posted: 08/06/2001, 2:19 AM

Hi Joe

This has worked for me:

In the "After Insert" event in your form, interrogate your database to find
the ID of your newly created record. The exact SQL you use will depend on
whether any specific item in your registration form (e.g. UserName) is
unique, but it'll go something like this:

sql = "Select max(Record_ID) as recid from tablename where username = '" &
fldUserName & "'"

Where fldUserName is one of the items you're collecting on your registration
form.

This will ensure you get the most recent record for that username.

You can then open a recordset:

openrs rsID, sql
newid = clng(rsID("recid")) 'assumes you're using a long integer /
autonumber for your id

et voila, you now have your record ID, which you can pass on to the next
page.

Hope this helps.

Alistair McFadyen


--

Managing Director
NetFocus Solutions Ltd
2 Cockburn Place
Riverside Business Park
Irvine, Ayrshire, KA11 5DA
email: amcfadyen@netfocus-solutions.co.uk
Internet: www.netfocus-solutions.co.uk


"JHoffman" <jhoffman@aol.com> wrote in message
news:9kfbll$cn7$1@news.codecharge.com...
> OK, I've searched this board and the examples for a answer to this
problem.
> I've created a non-login signup form. Anyone can fill out the form then
> submit it. I then want to bring that same info for the newly created
record
> into a new form for the user to check and confirm their entries.
>
> Because I don't have a user ID being created by a login, how do I
> immediately grab the automatically created Record_ID to recall that
record's
> fields into the next form? Is there a way to set a unique ID that I can
put
> into the db and transfer it to the next form as an input variable?
>
> I'm using ASP and Access.
>
> Thanks in advance for your .
>
> Joe Hoffman
>
>

Don Oldenburg
Posted: 08/06/2001, 8:34 AM

I have the following code added, but I now get an "open" error. My field
type for task_id is INT in SQL.

Advise?



sql="select max(task_id) as taskid from tasks where date_last='" &
flddate_last_h & "'"
open rsTASK, sql
newid=clng("taskid")

"Alistair McFadyen" <amcfadyen@netfocus-solutions.co.uk> wrote in message
news:9klnep$2ie$1@news.codecharge.com...
> Hi Joe
>
> This has worked for me:
>
> In the "After Insert" event in your form, interrogate your database to
find
> the ID of your newly created record. The exact SQL you use will depend on
> whether any specific item in your registration form (e.g. UserName) is
> unique, but it'll go something like this:
>
> sql = "Select max(Record_ID) as recid from tablename where username = '" &
> fldUserName & "'"
>
> Where fldUserName is one of the items you're collecting on your
registration
> form.
>
> This will ensure you get the most recent record for that username.
>
> You can then open a recordset:
>
> openrs rsID, sql
> newid = clng(rsID("recid")) 'assumes you're using a long integer /
> autonumber for your id
>
> et voila, you now have your record ID, which you can pass on to the next
> page.
>
> Hope this helps.
>
> Alistair McFadyen
>
>
> --
>
> Managing Director
> NetFocus Solutions Ltd
> 2 Cockburn Place
> Riverside Business Park
> Irvine, Ayrshire, KA11 5DA
> email: amcfadyen@netfocus-solutions.co.uk
> Internet: www.netfocus-solutions.co.uk
>
>
> "JHoffman" <jhoffman@aol.com> wrote in message
>news:9kfbll$cn7$1@news.codecharge.com...
> > OK, I've searched this board and the examples for a answer to this
> problem.
> > I've created a non-login signup form. Anyone can fill out the form then
> > submit it. I then want to bring that same info for the newly created
> record
> > into a new form for the user to check and confirm their entries.
> >
> > Because I don't have a user ID being created by a login, how do I
> > immediately grab the automatically created Record_ID to recall that
> record's
> > fields into the next form? Is there a way to set a unique ID that I can
> put
> > into the db and transfer it to the next form as an input variable?
> >
> > I'm using ASP and Access.
> >
> > Thanks in advance for your .
> >
> > Joe Hoffman
> >
> >
>
>


   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.