Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2013
    Posts
    6

    Unanswered: Form reminders for specific user only

    Hello.
    In my database, I have a form of reminder.
    Query collect all the information about the unfinished business at the base and at the start-up of the base shows form reminders.
    The base is splitet into front and back end, and are located on the server. Each user is assigned rights what can be done in the database.
    The problem where I am "stuck" is to make the form reminder that can be seen only by those users whose jobs are not completed and not all users of the database. Each user uses his computer with your username and password. I tried to connect to form reminder with this information, but I failed.
    I searched all the forums but have not found such an example.
    Does anyone know how to overcome this problem ?

  2. #2
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    Quote Originally Posted by Kolos View Post
    ...
    The base is splitet into front and back end, and are located on the server. ...
    Just a remark here: a copy of the front-end should be placed on any client computer from where it should be started.

    As you do not provide any kind of information about the data structures, I'll suppose that the query collecting all the information about unfinished business (let's call it [qry_UnfinishedBusiness]) has a column that identifies the user concerned by an unfinished business. Let's call this column [UserName].
    I'll also presume that you have a mean of identifying the user that opened the database. Let's call that variable or column [LoginName].

    In the startup procedure, all you need to do is to compare [LoginName] with the set of [UserName] returned by the query. Depending on the actual implementation and the nature of the data you can use a query, a DLookUp() or DCount() function or an Eval() function. For a query, the criteria should be something like:
    Code:
    WHERE [LoginName] IN ( (SELECT [UserName] FROM qry_UnfinishedBusiness) );
    Another example using Eval() in VBA:
    Code:
    Sub OpenReminderForm()
    
        Const c_SQL As String = "SELECT UserName FROM qry_UnfinishedBusiness;"
    
        Dim rst As DAO.RecordSet
        Dim strList As String
        
        ' Create the list of UserName's
        '
        Set rst = CurrentDb.OpenRecordset(c_SQL, dbOpenSnapshot)
        With rst
            Do Until .Eof
            If Len(strList) > 0 Then strList =strList & ", "
            strList =strList & "'" & !UserName & "'"
            .MoveNext
            Loop
            .Close
        End With
        Set rst = Nothing
    
        ' Compare the list of UserName's (strList) with LoginName
        ' and open the form "reminder" if a match is found.
        '
        If Eval("'" & LoginName & "' IN ( " & strList & " )") = True Then
            DoCmd.OpenForm "reminder"
        End If
    
    End Sub
    Provide precise information about the query and the way the user is identified if you want a more specific answer.
    Have a nice day!

  3. #3
    Join Date
    Feb 2013
    Posts
    6
    Thank you very much for your prompt response.
    Copy of the front-end should be placed on any client computer….
    I know, but as the base of the "test" work and need often make corrections in it, it is still on the server. When all updates are complete, everyone will get a copy of front-end base.

    And yes. You are right. Query collects all the unfinished business from the base. Basically from only one table, based on the callback expiration date.

    On load of Main form i have:


    Dim intStore As Integer
    intStore = DCount("[Naziv_plana_u_izradi]", "[tblUslovi_detalj]", "[Dat_podsetnik] <= Now() AND [sa_liste] =0")
    If intStore = 0 Then
    Exit Sub
    Else
    If MsgBox("Ima " & intStore & " uslova koji misu stigli" & _
    vbCrLf & vbCrLf & "Hocete li da ih pogledate odmah?", _
    vbYesNo, "Uslovi koji kasne...") = vbYes Then
    DoCmd.Minimize
    DoCmd.OpenForm "frmReminders", acNormal
    Else
    Exit Sub
    End If
    End If


    [sa_liste] is check box, which when clicked removes the job from the list.

    Username and password for the database user is different from the user names and passwords for logging into the IT system.
    And i have table: tbl_AssignUsersToGroups, tbl_UserAccess, tbl_ObjectControls, tbl_Groups, tbl_ControlsToDisable which used to allocate rights to users.

Posting Permissions

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