Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Updating two tables

Status
Not open for further replies.

ChristianX

Programmer
Mar 17, 2003
14
0
0
GB
what i am trying to do is this:

1)The user can click a link to bring up all the items in the database they have added
2)The user can then click a particular item (which is a link) to bring them to a page with the details of that item

Now instead of the add or delete option i wish to add another button-Approve Item. So if a user puts an item up for sale they can delay putting it for sale until they approve it. If they decide to definately post it for sale they can click approve: This will approve the item for selling and will initiate the following to occur:

1) Approve the item and add the record displayed to an ApprovedItems table
and
2) Delete the item from the old Items table (to save on memory)


The items in the Approved Items table will be made available to view by users.

How do i implement such a page? To delete from one table whilst at same time adding the same record to another table?

Thanks to anyone who reads this and can help!
 
Why don't you have a yes/no flag in your original table called approved, then you won't need an approved table at all.

However, If you require the approved table then you will need to run two SQL queries. I would get the contents of your record and put it in your new table, then delete your original record (in that order) in case there are any errors, at least you have two copies of one record rather than no copies after deleting.

Hope this makes sense, BDC.
 
hey all,
yes i have been suggested to there this morning about adding a boolean field to the approved table which does away with the proces of having another table and adding/deleting each time. If i add this boolean field wil it allow me to do the following?

1) Only show records that have Approved=Yes
2) Only show records that have Approved=No
and
3) Open a record and when clicking the approve button will change the Approved value= Yes

? will addition of such a field permit all the above?

thanks guys,
 
Yes, all the above will be possible using this method BDC.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top