+ Reply to Thread
Results 1 to 9 of 9

Vba to increment counter each time a record is deleted or added to Database

  1. #1
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,237

    Vba to increment counter each time a record is deleted or added to Database

    Hi All

    I sincerely hope someone can assist. I have a Database Sample attached. I want to find out if it is possible that each time I add a New client, a counter can be incremented for current month i.e. If I add a new client today, I want Cell G5 to become 1....If I add another new client tomorrow, Cell G5 must become 2.

    Same goes for if I delete a client then Cell G7 must become 1 etc.

    Is something like this possible with excel.
    Attached Files Attached Files

  2. #2
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,237

    Re: Vba to increment counter each time a record is deleted or added to Database

    Hi All

    I managed to figure out the first part....incrementing by one. However, how can I check to see what date it is and add it to that particular month column.

    Here is current code:

    Please Login or Register  to view this content.
    Attached Files Attached Files

  3. #3
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,237

    Re: Vba to increment counter each time a record is deleted or added to Database

    Nope, just noticed that F9 = "" so is always going to be less than F2
    How can I get on auto_open the total cells with text to be populated into a cell without it changing when I make changes to dataform.

  4. #4
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,237

    Re: Vba to increment counter each time a record is deleted or added to Database

    Something like this ?
    Please Login or Register  to view this content.

  5. #5
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,237

    Re: Vba to increment counter each time a record is deleted or added to Database

    K, well got that figured out finally:
    Please Login or Register  to view this content.

  6. #6
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,237

    Re: Vba to increment counter each time a record is deleted or added to Database

    Right, now to get the date part sorted out. I need to check current date and edit cell under that Month
    Have got this so far but does not work.

    Please Login or Register  to view this content.

  7. #7
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,237

    Re: Vba to increment counter each time a record is deleted or added to Database

    I need to get Month Name out of this code:
    Please Login or Register  to view this content.

  8. #8
    Forum Expert millz's Avatar
    Join Date
    08-14-2013
    Location
    Singapore
    MS-Off Ver
    Excel, Access 2016
    Posts
    1,694

    Re: Vba to increment counter each time a record is deleted or added to Database

    Quote Originally Posted by sintek View Post
    I need to get Month Name out of this code:
    Please Login or Register  to view this content.
    多么想要告诉你 我好喜欢你

  9. #9
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,237

    Re: Vba to increment counter each time a record is deleted or added to Database

    Hi All

    Thanks for your views. Think I got it figured out.
    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] When record is created/deleted in Table1, then add/delete record to Table2
    By michellepace in forum Excel General
    Replies: 1
    Last Post: 11-26-2015, 04:45 AM
  2. Replies: 2
    Last Post: 09-08-2014, 05:31 PM
  3. Replies: 3
    Last Post: 07-23-2014, 03:21 AM
  4. Replies: 3
    Last Post: 06-03-2014, 12:29 AM
  5. Increment a counter by 1 for every 4 cells the same.
    By sravilob in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-05-2013, 09:22 AM
  6. Macro to increment a counter
    By tleee in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-16-2012, 07:53 PM
  7. [SOLVED] Increment a counter in Excel
    By COSdl in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-14-2005, 11:33 AM

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