Results 1 to 5 of 5
  1. #1
    FTW ODU is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Sep 2015
    Posts
    3

    Query Help

    So I'm new to Access and am having some basic troubles trying to get a simple query to work. I'm trying to setup a simple query where a person can type their last name and the form/query will output their employee ID. I've got it working the other way around but I cannot get what i want to work.
    Currently i have two tables, one is tblEmployeeInfo with three columns; Emp_Number (Primary key), First_Name, Last_Name. The second is tblLogin with three columns; Employee ID, Last Name, Date. The two tables are related with a One (tblEmployeeinfo) to many (tblLogin) relationship.
    IF anyone has any advice i'd greatly appreciate it!
    Regards,


    Josh

    here is a screenshot on my tables. Like i said, i know i'm new to this so it's really basic

    Click image for larger version. 

Name:	Tables.png 
Views:	10 
Size:	73.3 KB 
ID:	21896

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    Is Emp_Number an autonumber field?

    Why is LastName in tblLogin?

    Users should not work directly with tables and queries, only forms and reports.

    Date is a reserved word - should not use reserved words as names. Also, no spaces or special characters/punctuation (underscore is exception) in naming convention. Title case is better than all upper case.
    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. #3
    FTW ODU is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Sep 2015
    Posts
    3
    No Emp_Number is fully populated with all ID numbers from our HR. What i'm trying to do is have a form built that a user can type their last name in and the employee number will autopoulate. employees here don't really know their ID numbers as HR uses a 12 digit ID (rather dumb imo). So i want to use employee ID as the Primary Key but assume the user's won't know them, thus, why i'm trying to make a look up query for the form. ultimately this will be for a login database to track user logins

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    Use a form.

    Set up a multi-column combobox. http://datapigtechnologies.com/flash...combobox3.html

    I prefer VBA code to construct filter criteria. http://www.allenbrowne.com/ser-62.html

    Dynamic parameterized query may be another option but I never use them. Emp_Number is a text type field? http://datapigtechnologies.com/flash...tomfilter.html
    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. #5
    FTW ODU is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Sep 2015
    Posts
    3
    Quote Originally Posted by June7 View Post
    Use a form.

    Set up a multi-column combobox. http://datapigtechnologies.com/flash...combobox3.html

    I prefer VBA code to construct filter criteria. http://www.allenbrowne.com/ser-62.html

    Dynamic parameterized query may be another option but I never use them. Emp_Number is a text type field? http://datapigtechnologies.com/flash...tomfilter.html
    Thank you!!!!!!!!!!! My form is now working as i wanted. I really appreciate the help!

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

Similar Threads

  1. querry or report
    By kamnjoro in forum Access
    Replies: 1
    Last Post: 01-09-2014, 12:36 PM
  2. Update Querry
    By Daryl2106 in forum Access
    Replies: 6
    Last Post: 08-29-2013, 11:09 AM
  3. Search querry
    By sdc1234 in forum Queries
    Replies: 14
    Last Post: 06-22-2013, 08:21 AM
  4. Querry question.
    By ZJGMoparman in forum Queries
    Replies: 2
    Last Post: 02-20-2013, 11:37 AM
  5. Querry formating
    By Zoroxeus in forum Queries
    Replies: 0
    Last Post: 03-07-2006, 11:00 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