You have a couple of options, you could take the item with the highest
autonumber, this can be risky if the site is high traffic. If 50 people
made the same request at the same time its tough to guarentee that you'll
get the right ID.
The method I simply use is selecting that item based on the insertion.
SELECT MAX (ID)
FROM tbExamble
WHERE Value1=#Form.Value1# AND Value2=#Form.Value2#
where value1 and 2 where the items added in the insert statement. This
isn't perfect but it will select the highest Autonumber where the values are
equal to that of the insertion.
Steve Wach
B.Sc (Comp. Eng)
Software Engineer/Team Lead
Canadian Web Design & Consulting Inc.
A: 701-281 McDermot Avenue (McDermot & King)
P: 204-946-5155
C: 204-227-7414 (24 Hours)
F: 204-946-5156
E: [EMAIL PROTECTED]
W: http://www.cdnwebdesign.com
-----Original Message-----
From: Jonathan R. Karlen <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
Date: Thursday, August 03, 2000 9:12 AM
Subject: Access AutoiNumber Fields
>This is a multi-part message in MIME format.
>
>------=_NextPart_000_0004_01BFFD33.9974EEC0
>Content-Type: text/plain;
> charset="iso-8859-1"
>Content-Transfer-Encoding: 7bit
>
>How do you get the value used by Access in an AutoNumber field. For
>example, you insert a record into one table and then, within the same
>template, need to use the ID assigned to that record.
>
>
>
>***************************************
>Jonathan R. Karlen
>Karlen Internet Solutions
>Web Site and Application Development
>[EMAIL PROTECTED]
>http://www.karlen.com
>
>
>------=_NextPart_000_0004_01BFFD33.9974EEC0
>Content-Type: text/html;
> charset="iso-8859-1"
>Content-Transfer-Encoding: quoted-printable
>
><html xmlns:o=3D"urn:schemas-microsoft-com:office:office" =
>xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
>xmlns=3D"http://www.w3.org/TR/REC-html40">
>
><head>
><meta http-equiv=3DContent-Type content=3D"text/html; =
>charset=3Diso-8859-1">
><meta name=3DProgId content=3DWord.Document>
><meta name=3DGenerator content=3D"Microsoft Word 9">
><meta name=3DOriginator content=3D"Microsoft Word 9">
><link rel=3DFile-List href=3D"cid:[EMAIL PROTECTED]">
><!--[if gte mso 9]><xml>
> <o:OfficeDocumentSettings>
> <o:DoNotRelyOnCSS/>
> </o:OfficeDocumentSettings>
></xml><![endif]--><!--[if gte mso 9]><xml>
> <w:WordDocument>
> <w:View>Normal</w:View>
> <w:Zoom>0</w:Zoom>
> <w:DocumentKind>DocumentEmail</w:DocumentKind>
> <w:EnvelopeVis/>
> </w:WordDocument>
></xml><![endif]-->
><style>
><!--
> /* Style Definitions */
>p.MsoNormal, li.MsoNormal, div.MsoNormal
> {mso-style-parent:"";
> margin:0in;
> margin-bottom:.0001pt;
> mso-pagination:widow-orphan;
> font-size:12.0pt;
> font-family:Arial;
> mso-fareast-font-family:"Times New Roman";
> mso-bidi-font-family:"Times New Roman";}
>p.MsoAutoSig, li.MsoAutoSig, div.MsoAutoSig
> {margin:0in;
> margin-bottom:.0001pt;
> mso-pagination:widow-orphan;
> font-size:12.0pt;
> font-family:Arial;
> mso-fareast-font-family:"Times New Roman";
> mso-bidi-font-family:"Times New Roman";}
>span.EmailStyle15
> {mso-style-type:personal-compose;
> mso-ansi-font-size:10.0pt;
> mso-ascii-font-family:Arial;
> mso-hansi-font-family:Arial;
> mso-bidi-font-family:Arial;
> color:black;}
>@page Section1
> {size:8.5in 11.0in;
> margin:1.0in 1.25in 1.0in 1.25in;
> mso-header-margin:.5in;
> mso-footer-margin:.5in;
> mso-paper-source:0;}
>div.Section1
> {page:Section1;}
>-->
></style>
></head>
>
><body lang=3DEN-US style=3D'tab-interval:.5in'>
>
><div class=3DSection1>
>
><p class=3DMsoNormal><span class=3DEmailStyle15><font size=3D2 =
>color=3Dblack
>face=3DArial><span =
>style=3D'font-size:10.0pt;mso-bidi-font-size:12.0pt'>How do you
>get the value used by Access in an AutoNumber field.<span =
>style=3D"mso-spacerun:
>yes"> </span>For example, you insert a record into one table and =
>then,
>within the same template, need to use the ID assigned to that =
>record.<o:p></o:p></span></font></span></p>
>
><p class=3DMsoNormal><span class=3DEmailStyle15><font size=3D2 =
>color=3Dblack
>face=3DArial><span =
>style=3D'font-size:10.0pt;mso-bidi-font-size:12.0pt'><![if =
>!supportEmptyParas]> <![endif]><o:p></o:p></span></font></span></p>
>
><p class=3DMsoNormal><span class=3DEmailStyle15><font size=3D2 =
>color=3Dblack
>face=3DArial><span =
>style=3D'font-size:10.0pt;mso-bidi-font-size:12.0pt'><![if =
>!supportEmptyParas]> <![endif]><o:p></o:p></span></font></span></p>
>
><p class=3DMsoNormal><span class=3DEmailStyle15><font size=3D2 =
>color=3Dblack
>face=3DArial><span =
>style=3D'font-size:10.0pt;mso-bidi-font-size:12.0pt'><![if =
>!supportEmptyParas]> <![endif]><o:p></o:p></span></font></span></p>
>
><p class=3DMsoAutoSig><!--[if supportFields]><font color=3Dblack><span=20
>style=3D'color:black'><span =
>style=3D'mso-element:field-begin'></span><span=20
>style=3D"mso-spacerun: yes"> </span>AUTOTEXTLIST \s "E-mail=20
>Signature" <span =
>style=3D'mso-element:field-separator'></span></span></font><![endif]--><f=
>ont
>color=3Dblack><span =
>style=3D'color:black'>***************************************</span></fon=
>t><font
>color=3Dblack><span =
>style=3D'color:black;mso-color-alt:windowtext'><o:p></o:p></span></font><=
>/p>
>
><p class=3DMsoAutoSig><font size=3D3 color=3Dblack face=3DArial><span =
>style=3D'font-size:
>12.0pt;color:black'>Jonathan R. Karlen</span></font><font =
>color=3Dblack><span
>style=3D'color:black;mso-color-alt:windowtext'><o:p></o:p></span></font><=
>/p>
>
><p class=3DMsoAutoSig><font size=3D3 color=3Dblack face=3DArial><span =
>style=3D'font-size:
>12.0pt;color:black'>Karlen Internet Solutions</span></font><font =
>color=3Dblack><span
>style=3D'color:black;mso-color-alt:windowtext'><o:p></o:p></span></font><=
>/p>
>
><p class=3DMsoAutoSig><font size=3D3 color=3Dblack face=3DArial><span =
>style=3D'font-size:
>12.0pt;color:black'>Web Site and Application =
>Development</span></font><font
>color=3Dblack><span =
>style=3D'color:black;mso-color-alt:windowtext'><o:p></o:p></span></font><=
>/p>
>
><p class=3DMsoAutoSig><font size=3D3 color=3Dblack face=3DArial><span =
>style=3D'font-size:
>12.0pt;color:black'>[EMAIL PROTECTED]</span></font><font =
>color=3Dblack><span
>style=3D'color:black;mso-color-alt:windowtext'><o:p></o:p></span></font><=
>/p>
>
><p class=3DMsoAutoSig><font size=3D3 color=3Dblack face=3DArial><span =
>style=3D'font-size:
>12.0pt;color:black'>http://www.karlen.com</span></font><font =
>color=3Dblack><span
>style=3D'color:black;mso-color-alt:windowtext'><o:p></o:p></span></font><=
>/p>
>
><p class=3DMsoNormal><!--[if supportFields]><font color=3Dblack><span=20
>style=3D'color:black'><span =
>style=3D'mso-element:field-end'></span></span></font><![endif]--><font
>color=3Dblack><span style=3D'color:black'><![if =
>!supportEmptyParas]> <![endif]></span></font><font
>color=3Dblack><span =
>style=3D'color:black;mso-color-alt:windowtext'><o:p></o:p></span></font><=
>/p>
>
></div>
>
></body>
>
></html>
>
>------=_NextPart_000_0004_01BFFD33.9974EEC0--
>
>---------------------------------------------------------------------------
---
>Archives: http://www.mail-archive.com/[email protected]/
>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.
>
------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/[email protected]/
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.