Deleting Records from a form

  • Thread starter AxessTerminated
  • Start date
A

AxessTerminated

A form displays data from a query. There is a button on the form to
delete the record. The query is based on 2 tables (Appts has appt
info, and other table is person info). The tables are linked by a
field in the query (by SSN), but not in the database's relationship
view. I can't enforce referential integrity yet because each record
doesn't yet have a primary key (I have peoples' names, but not SSN,
until they come in and provide it).

So when I try to delete a record from the form (an appointment of
someone who has provided SSN), it deletes both the person and the
appointment. Any ideas?
 
C

Carl Rapson

A form displays data from a query. There is a button on the form to
delete the record. The query is based on 2 tables (Appts has appt
info, and other table is person info). The tables are linked by a
field in the query (by SSN), but not in the database's relationship
view. I can't enforce referential integrity yet because each record
doesn't yet have a primary key (I have peoples' names, but not SSN,
until they come in and provide it).

So when I try to delete a record from the form (an appointment of
someone who has provided SSN), it deletes both the person and the
appointment. Any ideas?

If all you want to delete is the appointment info, I would simplify the
query to use only the appointment table and populate the unbound 'person'
information fields separately. You can do this in the Form_Current event by
opening a recordset against the 'person info' table for the person specified
in the appointment record, then populating the appropriate controls from
this recordset. That way, when you delete the record, onlythe appointment
information is deleted.

Carl Rapson
 

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