A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

User interface for deleting a record form a table



 
 
Thread Tools Display Modes
  #1  
Old February 12th, 2009, 02:16 PM posted to microsoft.public.access.tablesdbdesign
wolfpack
external usenet poster
 
Posts: 15
Default 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  
Old February 12th, 2009, 02:58 PM posted to microsoft.public.access.tablesdbdesign
Dorian
external usenet poster
 
Posts: 542
Default 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  
Old February 12th, 2009, 03:51 PM posted to microsoft.public.access.tablesdbdesign
wolfpack
external usenet poster
 
Posts: 15
Default 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  
Old February 12th, 2009, 04:38 PM posted to microsoft.public.access.tablesdbdesign
Piet Linden[_2_]
external usenet poster
 
Posts: 280
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 12:30 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.