Results 1 to 6 of 6
  1. #1
    Sgligori is offline Novice
    Windows 7 32bit Access 2013
    Join Date
    May 2015
    Posts
    3

    Vlookup in Access?

    I have a table called "Do Not Sell" with a list of items that should not be sold. I have another table called "Sales" that show all the sales for the month. How can I reference the "Do Not Sell" table to pull over a "Y" or "N" value for each item sold (if the item is on the "Do Not Sell" table, I want it to be flagged "Y"). In Excel, I would simply do a vlookup to determine whether the item is on the "Do Not Sell" list. I'm not sure how this is done in Access. I've heard about Dlookups as the Access-alternative, but I don't know how to apply it to my specific case. Any help would be much appreciated! Thanks!



    Also, I'm not sure whether it's mentioning, but I don't have a primary key. The "Do Not Sell" list is just a table containing one column- the manufacturer codes for the items.

  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    If I understand you correctly, you would build a query to find items in the Do Not Sell list that are in the Sales table. It should be as simple as creating a JOIN and adjusting the properties of the join. I would use the Query Designer. You can build a query by clicking the Query Design button from within the Ribbon. It is located under the Create tab.

  3. #3
    Sgligori is offline Novice
    Windows 7 32bit Access 2013
    Join Date
    May 2015
    Posts
    3
    The join query results only show the items from the Sales that are on the Do Not Sell list. I want my updated table to show all the sales WITH the items that are on the Do Not Sell list flagged.

  4. #4
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    Perhaps you can adjust the properties of your JOIN to display all records from table Sales and only those from DoNotSell that have equal values. Double clicking the line that is the JOIN is a shortcut to the properties window.

    You can add an alias to your query by typing syntax int the grid. Use a new column in the field row. Maybe an IIf statement is in order. Here is an example of adding an alias with the name NoSaleList
    NoSaleList: IIf([tblName].[FieldName]<>"",'Yes','No')

  5. #5
    Sgligori is offline Novice
    Windows 7 32bit Access 2013
    Join Date
    May 2015
    Posts
    3
    It worked! Thank you!

  6. #6
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    You bet...

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

Similar Threads

  1. Vlookup or similar for Access
    By ladyjoa in forum Access
    Replies: 4
    Last Post: 04-25-2014, 11:44 AM
  2. VLookup function in Access?
    By mveda2004 in forum Queries
    Replies: 2
    Last Post: 02-25-2013, 09:42 PM
  3. VLookup? in Access 2010
    By Lazor78 in forum Database Design
    Replies: 1
    Last Post: 07-25-2012, 03:34 AM
  4. Vlookup in Access with SQL
    By jogunjobi in forum Queries
    Replies: 1
    Last Post: 01-30-2012, 07:25 PM
  5. Vlookup function in access
    By rici7 in forum Forms
    Replies: 1
    Last Post: 10-16-2010, 04:41 PM

Tags for this Thread

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