Record being added twice

kbreiss

Registered User.
Local time
Today, 08:56
Joined
Oct 1, 2002
Messages
228
Whenever I fill out my form and click on the add button (macro) it is adding the same record twice to my table. Below is the query that I am using to run the "add button." Any suggestions would be greatly appreciated....I am stuck! Thanks in advance!

INSERT INTO Appointment ( DL_NUM, NAME, FACILITY_NAME, APPT_DATE, APPT_TIME )
SELECT FORMS![Appointment]![DL_NUM], FORMS![Appointment]![NAME], FORMS![Appointment]![FACILITY_NAME], FORMS![Appointment]![APPT_DATE], FORMS![Appointment]![APPT_TIME];
________
Gm Foods
 
Last edited:
Is your form based on the Appointments table?

If it is not disregard the stuff below ...

If it is, when you fill in the fields on the form you are entering data into the table. When you click on the button you are copying that data into the table a second time (copying a first time? - for the pedants amongst us, me included!)

Actually, the data you type into the form is not written to the underlying table until you move off that record, close the form, explicitly write (save) the data etc. but for all intents and purposes (for the moment) you are writing directly into the table. You do NOT need to 'save' the data cos it will already be saved for you.

Jeff
 
Thanks Jeff....I created a macro "add record" in the form and deleted the query I was running to save it. I added a msgbox that stated the record had been saved and moved the user back to the switchboard. This has prevented the record from being written to the table twice. Thanks

Kacy
________
NO2 VAPORIZER
 
Last edited:

Users who are viewing this thread

Back
Top Bottom