Quantcast
Channel: Creating Table For Temp Use
Viewing all articles
Browse latest Browse all 4

Creating Table For Temp Use

$
0
0

I'm trying to create a routine that allows users to create/edit data in a contact management database. I have a table of contact information that has the contactID as a key so I can use the information in that table in a subform to display multiple contacts (cells phones, email, etc.) for an individual. The idea I had for when I want to add or edit contact information was to use a temporary table (see below for what I mean by a “temporary table”) to put the contact information for a specific user and link to it while the user edits the information about that contact. I.e., they hit a button on the form (Add a Record or Edit This Record) that populates text boxes in a new form with the data from the record. If it is a new record it links to the temporary table with no data in it and the user can add contact information. If they are editing an existing record that has contact information, I populate the temporary table with the data from the existing record and they can then add/edit/delete information. When they confirm their changes the data is added/updated in the permanent tables. The data in the temporary table is removed when the user is finished adding/editing.

The temporary table is actually a permanent table called tblTempAddContact.  It does not have a ContactID key; it just displays all the records it has.  Since the code controls what records are there the key field is not necessary.

This works well if I am the only user, but I can see that this will cause problems if there are multiple users adding/editing records at the same time. Aside from the problem of two people trying to edit the same record (I think I have to deal with that separately), the problem is that if user 1 is editing a record and data is added to the temporary table and sitting there when user 2 goes to edit a different record, they will get crossed up with the data in the temporary table.  I'm assuming user 2 will not even be able to edit a record because the system will not be able to modify the data in the table that is linked to the data entry form user 1 has open.

I see some possible solutions to my problem but they seem a bit convoluted.  I’m hoping that there is a cleaner, more standard, way of solving it that the community can point to.


Viewing all articles
Browse latest Browse all 4

Latest Images

Trending Articles





Latest Images