Confirmation number

O

Orane

Good day to you.
I have a form on a web site that is link to access data
base, which is working fine. How can I post the
autonumber from the access database onto the confimation
page for my form? I would love to use that number as a
order number.

Thank you for your help...
 
K

Kevin Spencer

That's going to be a bit tricky, as an Autonumber field value is created
when the record is first inserted. Therefore, after inserting the record,
you have to re-select it back out in order to get the Autonumber value that
was inserted previously. Of course, the trick is knowing how to select that
record, as others may have been inserted at nearly the same time.

Using "straight" ASP, this is typically done by using an ADO RecordSet
object to do the insert. The RecordSet is pulled from the database, a new
record is added, and the RecordSet's Update method is called to make the
round trip back to the server to add the record. Afterwards, you can read
the Autonumber field's value in the record from the RecordSet.

I'm not sure how you might do this with FrontPage tools. You would have to
have enough criteria to determine what column value(s) make the record
unique in the database, other than the AutoNumber field. Then you would have
to query the database to find the record you just inserted using those
criteria.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
 
M

mbconsulting

Assuming you have setup the primary key as an auto number
field, you could simply create an Access query that does
a query on the table and use the Max record function. I
typically usethis funtion in SQL, however, I belive
Access uses something similar.

Once you have created the query, simply build your
submission forms confirmation page to pull up the max
record query which will be the last submission into your
table.

Let me know if this makes sense.

mbconsulting
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top