Results 1 to 6 of 6
  1. #1
    pdowg881 is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Apr 2015
    Posts
    14

    Display records when two OTHER fields match

    I currently have a query that uses a function to get the current users email address. This is matched with a "Teacher Email" address in a table of students to only show students which match the logged in teacher. I'd like to modify this so the teacher can see any student in their department. Is there a way to do this without creating a separate "Teachers" table that would contain a department and email?



  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    Have you tried using the Query Designer to add the table of students to the query and join on the email address?

  3. #3
    cbende2's Avatar
    cbende2 is offline Competent Performer
    Windows 7 32bit Access 2013
    Join Date
    Jun 2014
    Location
    Louisiana
    Posts
    370
    I'm curious as to why wouldn't you want to create a separate teachers table?

  4. #4
    pdowg881 is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Apr 2015
    Posts
    14
    Thanks. I just made the separate table and joined on department to do the job.

  5. #5
    pdowg881 is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Apr 2015
    Posts
    14
    Whenever referencing this third field, I can't delete rows from my query or any form that use the query.

  6. #6
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    When you create a JOIN, you limit your options for updating fields in the query. You will not be able to delete a row. Also, I don't think you will be able to delete a row when a query uses a function in the criteria.

    It kinda goes back to the question in post #3. Is your table structure normalized? Why would you attempt to delete a row that has the name of a student from one table and information from another table?

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

Similar Threads

  1. Replies: 3
    Last Post: 05-07-2015, 10:24 AM
  2. Replies: 11
    Last Post: 03-14-2014, 09:50 AM
  3. Query to match dates in two fields
    By shoggy in forum Queries
    Replies: 2
    Last Post: 10-17-2013, 06:20 AM
  4. Match Table Fields
    By vinsavant in forum Access
    Replies: 1
    Last Post: 01-17-2013, 12:06 AM
  5. How does access match records?
    By johnmerlino in forum Access
    Replies: 4
    Last Post: 10-05-2010, 08:51 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