Re: How to prevent duplicate entries

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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]
.



Relevant Pages

  • Division of a (rather large) Gate level Combinational Design
    ... This is the second time I am posting to this group within a week, ... (Through google groups ... Synthesis (i.e. synthesis of parts of my design separately) was ... long combinational path (i.e. add registers or latches etc.). ...
    (comp.arch.fpga)
  • Re: Update current record information to a separate record status reco
    ... Take a look at an Update Query in Access. ... My original design suggestion still holds. ... but creating a "summary record" in a separate table only introduces the ... of synchronization with what is contained in your "details" table. ...
    (microsoft.public.access.forms)
  • Re: Separating Fields in Access
    ... Then create an update query that will update both fields ... Open the table in design view and delete the original TrackingNumber field. ... How are we to know which of the 7 characters goes where? ... I would like the "Traking Number" to be broken up into two fields ...
    (microsoft.public.access.gettingstarted)
  • Re: Entering Data
    ... what I would do is open the table in design view and add ... > I need to extract records from another program based on a date search. ... > file into a Imported Records table. ... I have created an update query to ...
    (microsoft.public.access.queries)
  • Update Query Corruption causing headache
    ... I have a simple update query in an Access 2000 database. ... However the moment I reopen it in the design view it changes ... Every other update field is auto corrected also. ... Auto rename feature but the problem still persists can anyone help cause it ...
    (microsoft.public.access.queries)