Results 1 to 4 of 4
  1. #1
    Opid is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2012
    Posts
    24

    Keep track of when the last time a form was ran (or button pressed)


    Hello, I was wondering if there is an easy way to keep track of when the last time a form was ran. I have a button on a form that assesses rent. I don't want the user to accidentally assess rent twice in one week. The rent is added to a transactions table with the date. I could look through the transactions table for latest date but the rent is not distinguishable from another certain transaction... Is the only way to create a new table that just stores when the assess button is pressed? or is there another more creative solution

  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,518
    If rent is indistinguishable from other transactions, I think you're stuck with a table to track the last date it was done. Another possibility that comes to mind is doing it automatically on the first of the month or whenever. You could have a db that assesses rent on start up and then closes itself, and run that db from Windows Scheduled Tasks. That's the type of thing I would probably do.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    Opid is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2012
    Posts
    24
    I like the scheduled task idea but the boss doesn't want to mess with that.... I created a table and an append query so every time rent is assessed a record is added with value of "date()". How should I set up my if statement then? currently: [CODE] IF [RentAssessed].[DateAssessed]<>date() THEN assess rent....[CODE] I also tried opening the table and going to the last record but I get the object doesn't contain the automation object 'RentAssessed'.... How can I access the record of this table. Currently this is all being done within an embedded macro. Should I just use code?

  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,518
    I would always use code, but if you want to keep the macro you'd use a condition along the lines of:

    DCount("*", "RentAssessed", "DateAssessed = Date()") = 0

    which should only be true when today hasn't been done.
    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. Replies: 4
    Last Post: 10-28-2011, 03:28 PM
  2. Replies: 7
    Last Post: 08-04-2011, 07:49 PM
  3. Lock Record when "Add" button is pressed
    By jo15765 in forum Access
    Replies: 34
    Last Post: 11-28-2010, 08:50 PM
  4. Track change in a form
    By jmk909er in forum Forms
    Replies: 5
    Last Post: 10-19-2010, 04:05 PM
  5. Track form and module design changes
    By c_smithwick in forum Modules
    Replies: 0
    Last Post: 05-11-2010, 10:28 AM

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