Re: How to prevent duplicate entries
- From: John Vinson <jvinson@xxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 10 May 2006 10:03:47 -0600
On Wed, 10 May 2006 08:19:02 -0700, Paul B.
<PaulB@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
I have a form, and due to a lack of planning, I have had to create a new
table to hold some of the data from that form in a different layout than what
was in the original table.
Whoa. If you're letting the FORM dictate the structure of the table,
you've got it backwards! Am I misunderstanding?
The problem I now have aftering getting my SQL insert working, is that it is
now possible for the user to save the data, make changes to the form, then
save it again. For the original table this is not an issue, but since my SQL
insert code is behind the SAVE command button, it will write another row in
the new table.
I should probably just re-do the entire database, but due to time
constraints, I would rather look for a work-around.
Does anyone have a suggestion on how to code my SQL insert so that if the
user has already saved the record once, that saving a second time would only
update the row and not write a second row?
Since we have no way to know what your current code is doing, nor what
you are trying to save where, all I can say is that you need to either
run an Update query (rather than an Append query), or use a recordset
and use the Edit method rather than the AddNew method. Care to post
your code?
Thanks in advance.....I'll start planning to rewrite the entire db now....
Do. And design the properly normalized tables FIRST, make sure you
have the fields and relationships right - and *then* start designing
the form.
John W. Vinson[MVP]
.
- Prev by Date: Re: Return the week # for a given date?
- Next by Date: Re: Adding date automatically
- Previous by thread: Re: How to prevent duplicate entries
- Next by thread: Re: Return the week # for a given date?
- Index(es):
Relevant Pages
|