If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
User interface for deleting a record form a table
How do I go about allowing a user to delete a record from a table. Here is
my situation. I have a main menu with command buttons. One of the button reads "Remove Reviewer". Right now the buttton does nothing. What I would like is when it is clicked to have a window open that allows the user to select a name (drop down menu I suppose) from the "reviewers" table. Once the name is selected I would like for the user to click on a button that says "Remove this Reviewer". Once this happens, the reviewer would be removed from the table along with any other info in that row. Thanks for the help and I apologize if this is not in the correct section. |
#2
|
|||
|
|||
User interface for deleting a record form a table
Your design will work. The only problem I see is if the reviewer is referred
to by another table, you could have referential integrity issues. It's always best to display a confirmation screen before deleting any record. -- Dorian "Give someone a fish and they eat for a day; teach someone to fish and they eat for a lifetime". "wolfpack" wrote: How do I go about allowing a user to delete a record from a table. Here is my situation. I have a main menu with command buttons. One of the button reads "Remove Reviewer". Right now the buttton does nothing. What I would like is when it is clicked to have a window open that allows the user to select a name (drop down menu I suppose) from the "reviewers" table. Once the name is selected I would like for the user to click on a button that says "Remove this Reviewer". Once this happens, the reviewer would be removed from the table along with any other info in that row. Thanks for the help and I apologize if this is not in the correct section. |
#3
|
|||
|
|||
User interface for deleting a record form a table
Thanks for the comments. However what I am really looking for is how to do
this. "Dorian" wrote: Your design will work. The only problem I see is if the reviewer is referred to by another table, you could have referential integrity issues. It's always best to display a confirmation screen before deleting any record. -- Dorian "Give someone a fish and they eat for a day; teach someone to fish and they eat for a lifetime". |
#4
|
|||
|
|||
User interface for deleting a record form a table
On Feb 12, 8:16*am, wolfpack
wrote: How do I go about allowing a user to delete a record from a table. Here is my situation. I have a main menu with command buttons. One of the button reads "Remove Reviewer". Right now the buttton does nothing. What I would like is when it is clicked to have a window open that allows the user to select a name (drop down menu I suppose) from the "reviewers" table. Once the name is selected I would like for the user to click on a button that says "Remove this Reviewer". Once this happens, the reviewer would be removed from the table along with any other info in that row. Thanks for the help and I apologize if this is not in the correct section.. use an unbound form with a combobox. If you want, include the primary key from the table in the combo in one of the columns (could be hidden). then in the Query, just reference the hidden column DELETE * FROM Reviewers WHERE ReviewerID=Forms!MyForm!MyCombo.Column(0); (Column 0 is the "leftmost" column). that would work from a query, but you would need to use SetWarnings to shut off the "Are you sure..." messages. So you could do this: dim lngPK as Long lngPK=Forms!MyForm!MyCombo.Column(0) strSQL = "DELETE * FROM Reviewers WHERE ReviewerID=" & lngPK CurrentDB.Execute strsql, dbFailOnError Allen Browne has some nice notes on returning # of records affected etc. www.allenbrowne.com |
Thread Tools | |
Display Modes | |
|
|