• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 430
  • Last Modified:

Assigning records for review to a user in Access 2007

Hello, I am attaching a form to this question that several experts here have been helping me with over a few months.  I want to add a new feature to the form for users so that, lets say there are 100 records, user1 can be assigned 50 to review and user2 can be assigned 50 to review.  Ideally, I would like to create a new form accessed from the switchboard where an administrator can select records based on some characteristics of table Imported.  The fields I envision using for this assignment are [Year] and [Call Number] where the form can divvy up records based on a range i.e. 1999 - 2010 records go to Jon, 1998 and earlier go to Bette or by call number in a similar fashion.  One thing of note is that the user information isn't drawn from a table but rather from the following module from mvps.org:

Option Explicit
Option Compare Database

Private Declare Function apiGetUserName Lib "advapi32.dll" Alias _
    "GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long

Function fOSUserName() As String
' Returns the network login name
    Dim lngLen As Long, lngX As Long
    Dim strUserName As String

    strUserName = String$(254, 0)
    lngLen = 255
    lngX = apiGetUserName(strUserName, lngLen)
    If (lngX > 0) Then
        fOSUserName = Left$(strUserName, lngLen - 1)
    Else
        fOSUserName = vbNullString
    End If

End Function

Currently, the user name isn't passed on to any underlying table until the user modifies a record in which case it is recorded in the imported.[Modified By] field.   If the administrator has the user names drawn from advapi32.dll when assigning records, do the experts here think an example of this form can be created?
EE-Example.accdb
0
Bevos
Asked:
Bevos
  • 3
  • 2
1 Solution
 
BevosAuthor Commented:
Hi I thought my question was a little vague, so I tried to do what I could in terms of formatting.  I don't yet know enough of the programming to do much there.  In the updated file you will see a form called frmAssign. The records in the table Imported now have a field Assigned where the username should be passed after using the frmAssign.  I suppose I will need to create a filter where onLoad filter frmSearchHighlight by fOSUserName = imported.assigned.  
There are a lot of things that need to be done on this form, and I don't expect any of the experts here to answer them all, but if you can give me any help on where to start it would be greatly appreciated and I will close the question and address again with questions tailored to the remaining issues.
EE-Example.accdb
0
 
Rey Obrero (Capricorn1)Commented:
test this

change the macro that open the frmSearchHighlight, adding Where clause  [Assigned]=fOSUserName()
EE-ExampleRev.accdb
0
 
BevosAuthor Commented:
Hi Cap, so I should just add a filter to this the open form command for fOSUserName?  Was there anything else in the code or should I re-post for those Qs?

Thanks, Bevo
0
 
Rey Obrero (Capricorn1)Commented:
try adding records to the table, with your username and some other usernames
then open the form see which records will display in the form.
0
 
Rey Obrero (Capricorn1)Commented:
try adding records to the table, with your username and some other usernames
then open the form and see which records are displayed in the form.
0

Featured Post

Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now