Page 3 of 4 FirstFirst 1234 LastLast
Results 31 to 45 of 58
  1. #31
    nmart1230 is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Dec 2013
    Posts
    43

    Okay, I get a Run-time error '2471': The expression you entered as a query parameter produced this error: 'RCDNMART'. The RCDNMART is my network login.

  2. #32
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,901
    You said the network logins were number values.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #33
    nmart1230 is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Dec 2013
    Posts
    43
    Okay sorry that was a typo. Network logins are a mix of letters and numbers. So , if someone has the same first initial and last name they put a corresponding number behind it.

  4. #34
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,901
    Need a field in EMPLOYEE LIST NEW with the network login USERNAME. Can change the existing UserName field to text and input the actual USERNAME values. Then the DLookup should work. So gather up all the usernames and enter into table.

    ![SCAN OPERATOR] = DLookup("ID", "[EMPLOYEE LIST NEW]", "UserName='" & Environ("USERNAME") & "'")

    Or maybe the DLookup should be looking at tblSecurity to get the employee ID?

    Why have [EMPLOYEE LIST NEW] and tblSecurity as separate tables?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #35
    nmart1230 is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Dec 2013
    Posts
    43
    Okay, when I try to change the UserName field to a text field I get a message saying " operation is not supported for this type of object" Why am I getting this message? I have all the usernames entered but I can't change the field type.

  6. #36
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,901
    Want to answer questions from my previous post? Maybe don't need to modify EMPLOYEE table. What fields does tblSecurity have?

    COULD NOT enter user names into field if it is not already a text type.

    I had no problem changing the field type for UserName. Did you remove the Lookup from the field settings first - change to TextBox?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  7. #37
    nmart1230 is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Dec 2013
    Posts
    43
    Okay, I got it to work for what I need. Thank you so so much! I have one last question. How do I keep the number from changing when a different user opens the form?

  8. #38
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,901
    What number?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  9. #39
    nmart1230 is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Dec 2013
    Posts
    43
    The ID number that the code gets from the table. Say if the original user works the record and then someone goes behind and opens that form it will put that users ID into that control overwriting the previous ID.

  10. #40
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,901
    Maybe:

    If IsNull(![SCAN OPERATOR]) Then
    ![SCAN OPERATOR] = DLookup("ID", "[EMPLOYEE LIST NEW]", "UserName='" & Environ("USERNAME") & "'")
    End If
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  11. #41
    nmart1230 is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Dec 2013
    Posts
    43
    Okay, another problem has come up from the code. The problem is on another form that is query based. When I open the form called "BATCH HEADER SHEET INPUT" in the "scan operator" control it shows the users login and not the "ID". This form needs to show users "ID" not their logins for security reasons. How would I go about doing this?

  12. #42
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,901
    Options:

    1. multi-column combobox

    2. include table with user ID in the form RecordSource, bind textbox to the ID field and set properties Locked Yes, TabStop No

    3. DLookup() expression
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  13. #43
    nmart1230 is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Dec 2013
    Posts
    43
    Okay, so management doesn't want combobox and option 2 doesn't work. The login is being stored on the table and this is where the query is getting it from. So, let's try the DLookup expression. I'm guessing it will be very close to the other expression that you gave me earlier in this thread? So, instead of "user='" & Environ("USERNAME") & "'") because I don't want the user who is running the query to be inputted in the control, what should be put there?

  14. #44
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,901
    Why doesn't option 2 work? How are tables related?

    I downloaded your db from earlier post. What should I look at? It doesn't have the form you referenced. If I remember right, there were some issues with the data in Employee table. The UserName is just a number. UserSecurity and User are empty. Do you want to provide current version?

    I am rather confused but maybe like:

    =DLookup("ID", "tablename", "userlogin='" & Me.Login & "'")
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  15. #45
    nmart1230 is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Dec 2013
    Posts
    43
    Here is the db with the form I mentioned earlier. For the query parameters enter in "test" for my test file. My luck it won't work right for you. Every time I upload my db for someone to look at it never works. Thanks!
    Attached Files Attached Files

Page 3 of 4 FirstFirst 1234 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 9
    Last Post: 04-01-2014, 05:06 PM
  2. Replies: 4
    Last Post: 06-30-2012, 02:01 AM
  3. Replies: 1
    Last Post: 04-17-2012, 12:27 PM
  4. How can i store expressions in table?
    By smahdih in forum Access
    Replies: 9
    Last Post: 10-28-2011, 05:32 AM
  5. How to store data many row in one table
    By dododo in forum Access
    Replies: 4
    Last Post: 06-25-2011, 12:42 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