Register Blogs FAQ Members List Social Groups Calendar Search Today's Posts Mark Forums Read

Go Back   DeveloperBarn Forums > Databases > Microsoft Access

Sponsored Links

Discuss "delete button" in the Microsoft Access forum.

Microsoft Access - Microsoft Access is a database for small to medium applications. Learn tips and tricks and best database practices here.


Closed Thread
 
LinkBack Thread Tools Display Modes
  #1  
Old May 20th, 2008, 05:40 PM
Barn Newbie
 
Join Date: May 2008
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 1
techker is an unknown quantity at this point
Default delete button

hey guys i was wondering.i wan't to make a report with a delete button next to it?

what code to i put?is there any tutorials for this??thx!!
Sponsored Links
  #2  
Old May 20th, 2008, 05:49 PM
sbenj69's Avatar
Moderator
 
Join Date: Mar 2008
Posts: 101
Thanks: 23
Thanked 30 Times in 22 Posts
Rep Power: 1
sbenj69 will become famous soon enough

Awards Showcase
Microsoft Windows Microsoft Access 
Total Awards: 2

Default

surely you mean form, right? If you meant report, think of the report itself being a piece of paper. What you're asking is, if I draw a delete button on my piece of paper, and I press that drawing with my finger, I want all of the rest of the ink to disappear from the piece of paper.

Hope that explains things better
  #3  
Old May 20th, 2008, 05:54 PM
Barn Newbie
 
Join Date: May 2008
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 1
techker is an unknown quantity at this point
Default

lol funny..

i mean in a report you see the clients with a link to the details. but i wan't next to the client a delete button.

but i think you mean i can only do it in a form .now the part for me is to make the form show the clients in the database.??
  #4  
Old May 20th, 2008, 05:59 PM
sbenj69's Avatar
Moderator
 
Join Date: Mar 2008
Posts: 101
Thanks: 23
Thanked 30 Times in 22 Posts
Rep Power: 1
sbenj69 will become famous soon enough

Awards Showcase
Microsoft Windows Microsoft Access 
Total Awards: 2

Default

It's as simple as using the query that you made your report with, you would merely change the form to continuous form in the properties. Include a delete button with each record. It's go-home time for me now..... Then off to billiards..... I will work on getting you a sample database to view tomorrow.
  #5  
Old May 20th, 2008, 06:14 PM
Barn Newbie
 
Join Date: May 2008
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 1
techker is an unknown quantity at this point
Default

thx i will try it out.
  #6  
Old May 21st, 2008, 04:48 AM
AOG123's Avatar
Lightning Master
 
Join Date: Mar 2008
Location: Fortress Of Solitude
Posts: 107
Thanks: 10
Thanked 27 Times in 21 Posts
Rep Power: 1
AOG123 will become famous soon enough

Awards Showcase
Microsoft Access 
Total Awards: 1

Default

Another option which i use in my dbs, see below,.

I like using this as its easy to put in a select case incase the the record is deleted by accident. Just create a command button in your continuous form and paste the code in the onclick event. Feel free to change the MsgBox message to whatever you like.

Code:
 On Error Resume Next
 Dim intAnswer As Integer
 intAnswer = MsgBox("Are you sure you want to Delete selected Line?", vbOKCancel, "Delete")
 Select Case intAnswer
    Case vbOK
    
     intAnswer = MsgBox("Final Warning - Continue and Delete Line?", vbOKCancel, "Warning! Delete")
         Select Case intAnswer
             Case vbOK
    
        DoCmd.SetWarnings (warningsoff)        
        DoCmd.RunCommand acCmdSelectRecord
        DoCmd.RunCommand acCmdDeleteRecord
                       
     Case vbCancel
    DoCmd.CancelEvent
        
 End Select
      
    Exit Sub

    MsgBox Err.Description
    Resume Next
    
 End Select
End Sub

Comments on this post
jmurrayhead agrees: nice
mehere agrees:
sbenj69 agrees:
Attached Files
File Type: zip VBA Delete.zip (15.2 KB, 10 views)
__________________
If i helped you, make me famous by clicking the

Last edited by AOG123; May 21st, 2008 at 04:54 AM.
The Following User Says Thank You to AOG123 For This Useful Post:
sbenj69 (May 27th, 2008)
  #7  
Old May 21st, 2008, 06:06 AM
Barn Newbie
 
Join Date: May 2008
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 1
techker is an unknown quantity at this point
Default

nice thx!

hey u was wondering.is it possible to merge to projects together?

like i made one that i want the same info in another db that im doing.

same form type.
  #8  
Old May 21st, 2008, 08:26 AM
Barn Newbie
 
Join Date: May 2008
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 1
techker is an unknown quantity at this point
Default

by the way the delete button does not work in your example?
  #9  
Old May 21st, 2008, 08:32 AM
jmurrayhead's Avatar
The Barnfather
 
Join Date: Mar 2008
Location: Reston, VA, USA
Posts: 941
Thanks: 22
Thanked 93 Times in 90 Posts
Blog Entries: 5
Rep Power: 4
jmurrayhead is a jewel in the roughjmurrayhead is a jewel in the roughjmurrayhead is a jewel in the roughjmurrayhead is a jewel in the rough

Awards Showcase
Microsoft Windows Microsoft SQL Server Microsoft .Net Classic ASP 
Total Awards: 4

Default

Quote:
Originally Posted by techker View Post
by the way the delete button does not work in your example?
Are you referring to AOG123's example? I just tested it and it works fine for me.
__________________
jmurrayhead
If you agree with me... click the icon!
If my post solved your problem, click the button in the lower right-hand corner of the post.

If you like it here...throw us a few bones to help
support us.

Join our Folding team: DeveloperBarn Folding

  #10  
Old May 21st, 2008, 08:36 AM
Barn Newbie
 
Join Date: May 2008
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 1
techker is an unknown quantity at this point
Default

Quote:
Originally Posted by jmurrayhead View Post
Are you referring to AOG123's example? I just tested it and it works fine for me.
?why is it then it does not work for me??is it the format?
Closed Thread

  DeveloperBarn Forums > Databases > Microsoft Access

Bookmarks

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Webform Default Button Devwhiz .Net Development 9 May 15th, 2008 01:15 PM
Display Radio Button Value onclick theChris JavaScript Programming 5 March 22nd, 2008 02:28 PM


All times are GMT -4. The time now is 01:08 AM.



Content Relevant URLs by vBSEO 3.2.0