Results 1 to 4 of 4
  1. #1
    Perfac's Avatar
    Perfac is offline Expert
    Windows 10 Access 2016
    Join Date
    May 2016
    Location
    Centurion Pretoria
    Posts
    618

    Monthly renewal password.

    If I am an accountant and customers pay me a monthly rent for system use and accounting service. Is there a tutorial somewhere that can show me how to get my system to ask for a password on the first day for every month. Or is there a genius that can tell me. Thank you very much.

  2. #2
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    You need a password generator based on the month/year and a table with user and month and password entered Y/N. When the database opens, check "this month" - look at the table and see if the user has successfully entered the password or not. If not, prompt them to enter it. If they are unable to then close the database. Make sure you switch off the ability for users to bypass any routines run on database open.

  3. #3
    Micron is offline Very Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,424
    I got a different meaning. I'm assuming you're providing the password based on payment, and at the first of the month, they don't get in unless they enter the password for that month. I'd rethink the approach for various reasons. If I will be locked out on Monday morning because we went into a new month over the weekend, I might look for a less punitive supplier of the service. Also, how have you protected the db from me getting at the tables (or whatever) to circumnavigate whatever flag the db uses to allow me in or not? If all that is taken care of and you want to maintain the present course, you'd need a date field in your password table as aytee111 noted. On the 1st of the month the db checks that the month part of the current date and the month part of the lastUpdated field match.
    Wouldn't a yearly or semi annual subscription be more manageable?
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  4. #4
    davegri's Avatar
    davegri is offline Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,742
    This code will check for the notification having been sent, and it not, provide wherewithall to sent it.
    But details remain as noted by other posters as to when to update tblUsers so that the message is not sent over and over
    unless the user has paid. How does this routine determine if paid?

    Code:
    'Update tblUsers with notification date
    'sub should be in the login form module
    'This routine should be called every time the user logs into the database 
    'Takes into account that the user may not log in on exactly the first of each month.
    'Add field RecDate to your tblUsers
    Sub subUpdate_tblUsers()
       Dim sSQL as string 
       Dim wDate As Date
    
    
        wDate = DLookup("RecDate", "tblUsers","WHERE UserName = '" & txtUserName & "'")
        'if notice for this month/year already sent, exit
        If Month(wDate) = Month(Date) And Year(wDate) = Year(Date) Then Exit Sub
    
    
        Call subSendUserMessage        ' email? msgbox? Don't know how you want to notify user
     
        'You may not want to run below update unless user has taken some action, like making a payment  
        sSQL = "UPDATE tblUsers SET RecDate = Date() WHERE UserName ='" & txtUserName & "'"
        CurrentDB.Execute sSQL, dbFailOnError
    End Sub
    Last edited by davegri; 01-17-2018 at 10:55 AM. Reason: syntax

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

Similar Threads

  1. Replies: 1
    Last Post: 06-03-2016, 03:58 AM
  2. Replies: 15
    Last Post: 09-01-2015, 12:20 PM
  3. Replies: 27
    Last Post: 08-14-2015, 05:59 PM
  4. Replies: 1
    Last Post: 05-11-2015, 11:31 PM
  5. Replies: 6
    Last Post: 11-10-2012, 09:49 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