i have got a unique ID for each customer and i get the form to search this ID and all the customers details appear. but i want the option for them to edit their details by changing what is in the textbox.
i can get it to save to a database and everything but instead of overwriting the same person, it adds a new person just with the same details in the database.

eg. ID is 345 and name is df
it searches for 345 and all details appear but if fi wanted to change df to different name like gf, then it would create a new person with ID same, 345 but different name gf.
so how do i get it to overwrite the old ID ?

much help would be appreciated

Edited by saddas: n/a

7 Years
Discussion Span
Last Post by AndreRet

clearly u r using insert_record in ur code u must use update the problem is in ur sql query
for example in mysql to add a new record we use command insert
if the table called customer for exampleu use this code
"insert into customer (id, name, fullname, tel) values ('" & text1.text & "', '" & text4.text & "', '" & text4.text & "', '" & text4.text & "')"

this command will insert new record to ur data base.

If you want to modify there u muste use update command;

"update customer set name='" & text2.text & "' and fullname='" & text3.text & "' and tel='" & text2.text & "' where id='" & text1.text & "'"


Paste your code. It all depends on whether you are using a control, adodc etc. What sql statement are you using?

Post some code so we can help.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.