+ Reply to Thread
Results 1 to 8 of 8

vba code to delete specific data from Access table

  1. #1
    Forum Contributor
    Join Date
    02-20-2009
    Location
    bristol
    MS-Off Ver
    Excel 2003
    Posts
    882

    vba code to delete specific data from Access table

    Hi All

    Can anyone please help me to write code in excel that will delete the records from Access table based upon a certain condition?

    Thanks a lot.

  2. #2
    Forum Contributor
    Join Date
    02-20-2009
    Location
    bristol
    MS-Off Ver
    Excel 2003
    Posts
    882

    Re: vba code to delete specific data from Access table

    Can anyone please answer my quesion?

    Thanks

  3. #3
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: vba code to delete specific data from Access table

    Hmm No, not really. You haven't given anywhere near enough information.

    1. What have you done so far? What have you tried and what is the goal of this project?
    2. Are you comfortable with SQL?
    3. Why don't you do this directly in Access?

  4. #4
    Forum Contributor
    Join Date
    02-20-2009
    Location
    bristol
    MS-Off Ver
    Excel 2003
    Posts
    882

    Re: vba code to delete specific data from Access table

    My whole project is developed in Excel as a frontend and Access as a backend. Now the client needs the ability to delete a dates worth of data. So that wehn they select the date from Excel userform and press Delete button then records for that date should be deleted from Access table. I know SQL so it will be something like as follows:
    Please Login or Register  to view this content.
    I hope now you can help me in wrting the vba code for this.

    Thanks

  5. #5
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: vba code to delete specific data from Access table

    What are you asking then? I'm confused, if you have a front end in Excel, you must be familiar with executing SQL against an access database.

    Have you tried your SQL? You'll need to adjust it slightly to:
    Please Login or Register  to view this content.

  6. #6
    Forum Contributor
    Join Date
    02-20-2009
    Location
    bristol
    MS-Off Ver
    Excel 2003
    Posts
    882

    Re: vba code to delete specific data from Access table

    I just wanted to know how to run this sql statement. Please see the below code and hope you can help me to complete it.

    Please Login or Register  to view this content.

  7. #7
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: vba code to delete specific data from Access table

    Maybe like this:

    Please Login or Register  to view this content.
    Although I struggle to understand how you have written a front end in Excel without executing any statements against access

  8. #8
    Forum Contributor
    Join Date
    02-20-2009
    Location
    bristol
    MS-Off Ver
    Excel 2003
    Posts
    882

    Re: vba code to delete specific data from Access table

    Thanks Kyle. It worked absolutely fine.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1