Results 1 to 5 of 5
  1. #1
    Thompyt is offline Expert
    Windows 8 Access 2010 32bit
    Join Date
    Sep 2014
    Location
    El Paso, TX
    Posts
    839

    Dlookup Assistance

    I don't know why I can't get the DLOOK up function in straight.

    All rows are set up as plain text

    Table:
    Data

    Columns
    [Row Type]; Plat, MEQUIP


    [Bumper # / Plat ID]; Many - non standard format
    [USA #]; Many - non standard format
    [Equip HB Name]; Not Like "*JCR*"

    What my intention is:
    A. Lookup all [USA #] that [Row type] = "Plat"

    to determine if under the [USA #] and [Row type] = "MEQUIP" where [Equip HB Name]; Not Like "*JCR*"

    Where this is true, then output = "Not assigned", not true is ignored.


    example:
    [Bumper # / Plat ID]
    [USA #]
    "Not Assigned"


    NAssigdJCR: IIF(Dlookup("[USA #]","[Data],"[Row Type] = "'Plat' &......,"Not Assigned")

  2. #2
    davegri's Avatar
    davegri is offline Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,412
    What my intention is:
    A. Lookup all [USA #] that [Row type] = "Plat"
    You may need to rethink this. Dlookup will find a maximum of ONE record.

  3. #3
    Thompyt is offline Expert
    Windows 8 Access 2010 32bit
    Join Date
    Sep 2014
    Location
    El Paso, TX
    Posts
    839
    Dave
    I have been trying this in a different manner. 1st Query [W_JCR] I find all [USA #] with [Equip HB Name] like "*JCR*"

    This part is simple.

    Code:
    SELECT DISTINCT Data.[Bumper # / Plat ID], Data.ID, Data.[USA #] AS USA
    FROM Data
    WHERE (((Data.[Bumper # / Plat ID])<>"") AND ((Data.[USA #])<>"") AND ((Data.[Equip HB Name]) Like "*JCR*") AND ((Data.[Row Type])="MEQUIP"));
    Now I added a second query with the table [Data] and query [W_JCR]. I was hoping to use the first query to filter out all the [USA #] and list the remaining [USA #]

    Code:
    SELECT DISTINCT Data.[Bumper # / Plat ID], Data.[USA #]
    FROM Data, [1-Data w_JCR]
    WHERE (((Data.[Bumper # / Plat ID])<>"") AND ((Data.[USA #])<>[usa]) AND ((Data.[Row Type])="Plat"));
    
    But it is not even close and lists all [USA #].   
    
    Please advise.
    
    Thanks

  4. #4
    davegri's Avatar
    davegri is offline Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,412
    Your data names are very confusing to me and probably to Access.
    [Bumper * / Plat id] could be interpreted as bumber# divided by Platid
    1-Data could be interpreted as 1 minus Data
    And do you really have a data item named [1-Data w_JCR] ?
    # is a delimiter for dates
    Good practice indicates NO spaces or special characters in data names.

    Have you tried to develop the 2nd query in the query design grid?

  5. #5
    Thompyt is offline Expert
    Windows 8 Access 2010 32bit
    Join Date
    Sep 2014
    Location
    El Paso, TX
    Posts
    839
    I didn't choose the data names. They are an import. Query names I made up to find at top. I was being lazy about the spaces.

    1 placed query at top. Data was then table, w_JCR was the item I was looking for.

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

Similar Threads

  1. Dlookup Assistance
    By Thompyt in forum Programming
    Replies: 3
    Last Post: 09-22-2016, 03:18 PM
  2. VBA assistance
    By Kwbrown in forum Programming
    Replies: 3
    Last Post: 03-15-2014, 03:09 PM
  3. Qry Assistance Please
    By buck in forum Access
    Replies: 8
    Last Post: 12-31-2013, 08:52 AM
  4. Loop Assistance
    By MegA248 in forum Forms
    Replies: 7
    Last Post: 05-01-2013, 12:24 PM
  5. dlookup assistance
    By underscore in forum Access
    Replies: 4
    Last Post: 12-28-2011, 06:32 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