Results 1 to 4 of 4
  1. #1
    jaymin is offline Advanced Beginner
    Windows Vista Access 2003
    Join Date
    Jan 2012
    Location
    gold coast Australia
    Posts
    57

    Cool using cascading combo box to select and then delete records

    Hi all,
    I have a database that allocates portfolios to staff, so i have three tables 1,Staff 2,Portfolio 3,Allocated Portfolio, what i want to do is to be able to delete the allocation by using two cascading combo boxs, the first combo selects the staff, the second the portfolio that is accociated to that staff member. i can get the combo to cascade with the right data but i cannot get it to then delete the selected record from the table.
    hope someone can put me on the right track.


    Peter
    Click image for larger version. 

Name:	portfolio.jpg 
Views:	11 
Size:	33.6 KB 
ID:	17979

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,772
    Deleting records should be a rare occurrence. Why do you want to delete? Why can't you do that? What have you tried? Post code. What happens - error message, wrong result, nothing?

    Something like:

    CurrentDb.Execute "DELETE FROM tblPortfolioAllocation WHERE IDPortfolioAllocation = " & Me.comboboxname
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Demerit's Avatar
    Demerit is offline Competent Performer
    Windows 7 32bit Access 2007
    Join Date
    Nov 2013
    Posts
    125
    Currentdb.Execute "DELETE * FROM tblPortfolioAllocation WHERE IDPortfolioAllocation =" & Me.ComboName
    CurrentDb.Execute "DELETE * FROM tblStaff WHERE StaffID =" & Me.ComboName

  4. #4
    jaymin is offline Advanced Beginner
    Windows Vista Access 2003
    Join Date
    Jan 2012
    Location
    gold coast Australia
    Posts
    57
    Quote Originally Posted by Demerit View Post
    Currentdb.Execute "DELETE * FROM tblPortfolioAllocation WHERE IDPortfolioAllocation =" & Me.ComboName
    CurrentDb.Execute "DELETE * FROM tblStaff WHERE StaffID =" & Me.ComboName
    Hi Guys,
    Thank you for your quick reply, got what I wanted to work with your help many thanks, must have had a bit of a seniors moment.
    had formatting wrong.
    Peter

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 12
    Last Post: 02-01-2013, 02:25 PM
  2. Delete and/or Select Distinct records query
    By admessing in forum Queries
    Replies: 39
    Last Post: 02-14-2012, 03:50 PM
  3. Replies: 2
    Last Post: 01-24-2012, 02:16 PM
  4. Replies: 4
    Last Post: 10-18-2010, 09:44 PM
  5. Replies: 47
    Last Post: 06-17-2010, 03:04 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums