Results 1 to 5 of 5
  1. #1
    sephiroth2906 is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2011
    Posts
    73

    Query to look up all instances of name requested at startup

    Hello all,

    I have a form that passes information entered to a table. The form has a combo box which has the name of every employee listed as active based upon a different query, so the names will always be the same. I can see that the names are being passed to the table correctly.

    I want to pull up, using a query, every instance of an employee name, along with the related information (in this case late arrivals along with the reason, amount of time and date) I attempted to use a "Like" statement in criteria under name as follows:

    Like [Last name, First name]

    I had done something in the past (which of course, I cannot find) that utilized something similar, so I could pull up the first several letters of the last name and then get the information I am searching for, but in this case, although the input box comes up at start of query, I get absolutely nothing back, so I must have screwed something up.

    Anyone have an idea what that may be?



    Thanks!

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    How is the employee name stored - all in one field or multiple fields for name parts? Is the employee name the primary/foreign key or is there a unique employee ID field that is the pk/fk. Use the ID for search.
    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
    sephiroth2906 is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2011
    Posts
    73
    It is one field, and it is not the key. There isn't any way for the users of the program to know the pk/fk associated with the employee, and each employee can be entered multiple times for multiple violations, so I cannot make them the key.

    As I said, I know I have accomplished this once before, back when I was all studied up on access. Perhaps I need to start from scratch and try again.

    I welcome any other ideas.

    Thanks!

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Users don't need to know the pk/fk. They select the employee but code uses the pk/fk for search criteria. Use a multi-column combobox. The ID field is hidden, users select employee but the search refers to the ID column for criteria.
    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
    sephiroth2906 is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2011
    Posts
    73
    Ok. So, I just realized my query works exactly as written, and I am an idiot because I forgot to put the asterisk after the part of the last name I type. It is amazing what you can forget in a couple years.

    Thanks so much for the help!
    Last edited by sephiroth2906; 09-18-2012 at 03:13 PM. Reason: Did not want to double post

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

Similar Threads

  1. Counting instances across multiple tables
    By New_2_Access in forum Queries
    Replies: 1
    Last Post: 07-19-2012, 04:47 PM
  2. Startup query
    By erikl1 in forum Queries
    Replies: 3
    Last Post: 01-26-2012, 04:56 AM
  3. Cause query to ask for name at startup
    By sephiroth2906 in forum Queries
    Replies: 2
    Last Post: 01-11-2012, 01:45 PM
  4. Multiple Payment Instances
    By luckysarea in forum Queries
    Replies: 3
    Last Post: 04-21-2011, 03:29 PM
  5. Query Table for "*" and then Count all instances
    By Steven.Allman in forum Queries
    Replies: 14
    Last Post: 09-10-2010, 07:45 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