Overwrite submit?

N

n.repole

The form I've created will be sent along a chain of people, and each
time someone recieves the form they will resubmit it to a database.
The form will have a reference ID which is unique and stored in the
database. The issue I'm having is that when the form is submitted
after the first time, it can't add to the database because that
reference ID was already added before. So my question is

A. Is there a way upon attempting to submit to delete the original row
in the database table that contains the same referenceID and then
submitting the new record?

or

B. A way to simply get the new record to overwrite the old one.

If not, I'm in some big trouble :/
 
P

Paresh

The form I've created will be sent along a chain of people, and each
time someone recieves the form they will resubmit it to a database.
The form will have a reference ID which is unique and stored in the
database. The issue I'm having is that when the form is submitted
after the first time, it can't add to the database because that
reference ID was already added before. So my question is

A. Is there a way upon attempting to submit to delete the original row
in the database table that contains the same referenceID and then
submitting the new record?

or

B. A way to simply get the new record to overwrite the old one.

If not, I'm in some big trouble :/

I guess, before inserting, you can query the database for the
referenceID.
If it is present in the database, then instead of insert, you can
update the database record for the referenceID you have, else
you can perform insert operation.

Hope this helps.

Regards,
Paresh
 
N

n.repole

I guess, before inserting, you can query the database for the
referenceID.
If it is present in the database, then instead of insert, you can
update the database record for the referenceID you have, else
you can perform insert operation.

Hope this helps.

Regards,
Paresh- Hide quoted text -

- Show quoted text -

Makes sense theoretically, I'm just not sure how exactly to do it...
 
N

n.repole

What method are you using to save the form to the database? A webservice?







- Show quoted text -

Nope, a simple data connection. None of this will go online, just have
a access database on a shared drive and the form.
 
N

n.repole

Nope, a simple data connection. None of this will go online, just have
a access database on a shared drive and the form.- Hide quoted text -

- Show quoted text -

So just to clarify things, I'd need to either make a row in Access get
deleted, or make sure submit overwrites anything with the same ID.

If there's no way of doing this, is there anyway to only submit
certain fields with certain buttons? Such as having one button that
submits a select 5 fields, and another button that submits a different
5?
 
B

Bob C.

N,

The form cant be submitted because the reverence id is set as a unique key.
What you want to do is as Paresh stated, test for existence.

One way to do this would be to try an update, and if that fails, try an
insert. I am not sure if this is possible w/o code.

You may be able to create a rule in the submit, and test the result/return
code of the update statement.
 

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