Results 1 to 3 of 3
  1. #1
    scott0_1 is offline Advanced Beginner
    Windows Vista Access 2013 32bit
    Join Date
    Apr 2018
    Posts
    82

    Query asking for parameter to be entered, but I'm not sure why.

    I'll explain how I get to this query before I actually write it out. A user puts two columns of data into an Excel spreadsheet. That data gets put into a temporary table from a button push inside Access. The two columns are "EmpNo" and "PositionNo". I have tblEmployee and tblPositionNumbers.


    • tblEmployee has tblEmployee.PRI and tblEmployee.PNID.


    • tblPositionNumbers has tblPositionNumbers.ID and tblPositionNumbers.PositionNumber.


    • tblEmployee.PNID and tblPositionNumbers.ID are related.


    Before someone asks, many employees can occupy one position number. That's why I have a table for position numbers. That way, position numbers are easier to update (there are other fields in tblPositionNumber, but none are consequential to this question).



    Once the user confirms the import to Access was correct, I want to update tblEmployee.PNID to reflect any changes.

    The query I currently have is:

    Code:
    UPDATE tblEmployee SET tblEmployee.PositionNumber = tblImportTMP.PNID
    WHERE (([tblEmployee].[EmpNo]=[tblImportTMP].[EmpNo]));
    When I run the query, it is asking for a value for tblImportTMP.EmpNo, but I'm not sure why.

    Thanks for any help!

    Scott

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    Probably because tblImportTMP isn't actually in the query.

    UPDATE tblEmployee INNER JOIN tblImportTMP ON [tblEmployee].[EmpNo]=[tblImportTMP].[EmpNo] SET tblEmployee.PositionNumber = tblImportTMP.PNID
    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
    scott0_1 is offline Advanced Beginner
    Windows Vista Access 2013 32bit
    Join Date
    Apr 2018
    Posts
    82
    That worked.. Thanks!

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

Similar Threads

  1. Replies: 5
    Last Post: 03-02-2015, 03:07 PM
  2. Replies: 11
    Last Post: 02-09-2015, 02:20 AM
  3. Can "criteria" be an entered parameter?
    By lpkorn423 in forum Queries
    Replies: 1
    Last Post: 07-27-2012, 02:53 PM
  4. Replies: 6
    Last Post: 06-09-2011, 03:41 PM
  5. Replies: 5
    Last Post: 08-05-2009, 12:13 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