Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Want to overwrite record in table

Status
Not open for further replies.

innovation

Technical User
Jun 21, 2004
1
US
I am very new at Access and am using it for database purposes via a website.

I have calendars on a website for users to make reservations. When users click on the day of the month, which is the FrontPage form's submit button, it throws the day/month/year into a database table and takes the user to the next page where the data is retrieved from the database table and displayed, then all they have to do is pick the time and hit another submit button and the info is emailed to me so I can approve it. The only problem is I get additional dates listed each time the date is clicked, as a new record is created. How would I make it so the same record is overwritten each time?

I'm using Access 2003 and FrontPage 2003.

Thank you in advance for any help.
 
Hi,

All you need to do is ensure you have a unique key for each record and then update it using this key:

Code:
l_str_sql = "UPDATE MY_TABLE SET <my_field1> = <my_value1> WHERE <key_field> = " & l_my_key

You can update as many fields as you like by separating the fields and values with commas.

Andrew
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top