Link to home
Start Free TrialLog in
Avatar of Bevos
Bevos

asked on

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
Avatar of Bevos
Bevos

ASKER

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
Avatar of Rey Obrero (Capricorn1)
test this

change the macro that open the frmSearchHighlight, adding Where clause  [Assigned]=fOSUserName()
EE-ExampleRev.accdb
Avatar of Bevos

ASKER

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
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.
ASKER CERTIFIED SOLUTION
Avatar of Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1)
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial