Results 1 to 6 of 6
  1. #1
    rkalapura is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2011
    Location
    New York
    Posts
    69

    Database Usage Counter in Main Form

    Hai Guys,

    I am using Access 2010 and I have a small database in our company network, which is using by many of my collegues. I wish to put a counter on the Main Menu Form, which gives how many times this database is opened. I mean, every time I close the database and re-open it again, the counter should increment by one. My form name is "Main Menu" where I want to put the counter on the top right corner to see how many times this database has been opened for use.

    Thank you in advance for your help.


    Regards

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    If all you want is a count, create a table with one Long Integer field. In the load event of your form:

    CurrentDb.Execute "UPDATE TableName SET FieldName = FieldName + 1"

    In a textbox on your form

    =DLookup("FieldName", "TableName")
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    rkalapura is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2011
    Location
    New York
    Posts
    69
    Thanks Paul for the reply. It gives error. "Cannot identify Current Db........"

    Secondly I have already assigned a table to the main form. How can I assign the new table (I mean both tables) to my existing form?
    Thanks

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    What I posted is VBA code; it would go here:

    http://www.baldyweb.com/FirstVBA.htm

    The method I gave would be independent of the table the form is bound to. You don't have to assign anything.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    rkalapura is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2011
    Location
    New York
    Posts
    69
    Thank you Paul. It works fine now. Thanks a lot.

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Happy to help.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Database Counter
    By Kapelluschsa in forum Access
    Replies: 5
    Last Post: 08-10-2011, 02:41 PM
  2. Form Usage
    By crowegreg in forum Forms
    Replies: 7
    Last Post: 08-01-2011, 06:16 AM
  3. ID Counter Problem
    By slash23 in forum Access
    Replies: 2
    Last Post: 07-06-2011, 11:57 AM
  4. lap Counter
    By challenger in forum Access
    Replies: 4
    Last Post: 07-06-2010, 02:20 PM
  5. Replies: 0
    Last Post: 03-11-2009, 12:39 PM

Tags for this Thread

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