Results 1 to 6 of 6
  1. #1
    tanyapeila is offline Advanced Beginner
    Windows 7 64bit Access 2013
    Join Date
    Mar 2014
    Posts
    42

    If [FIELD] equals X then enter "TEST", If [FIELD] does not equal X then lookup ....

    I'm hoping someone can help me out.


    I have attached a copy of a report.
    I need to create a query (I think) to add to this report.

    Here is what I would like it to do.

    If the [CARRIER NAME] is equal to the [SCAC] then I would like it to enter "[SCAC] ~ Same as Consignee"
    If the [CARRIER NAME] is not equal to the [SCAC] then I would like it to look up the [ConsigneeName], [Address1], etc from a table and enter "[SCAC] ~ [ConsigneeName], [Address 1]

    All of the tables these fields are in are related properly just not sure how to set this up.

    Thanks!

    Click image for larger version. 

Name:	Capture.PNG 
Views:	8 
Size:	41.7 KB 
ID:	16101

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,849
    What is the recordsource of the Form?
    Could you post the associated SQL?
    Please explain SCAC, and where exactly do you want to enter the text strings?

  3. #3
    tanyapeila is offline Advanced Beginner
    Windows 7 64bit Access 2013
    Join Date
    Mar 2014
    Posts
    42
    Oh Orange my friend!!!
    So the record source is a Query pulling records where [SELECT] is true, basically a check box selecting which records to include on the report.

    SCAC - This is basically a transportation company code. Each transportation company has a unique code. This specific report is for Germany shipments. And the text strings would go where it says "(9) Also Notify"

    Thank you in advance for your help

  4. #4
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,849
    Please post the SQL of the recordsource.

  5. #5
    tanyapeila is offline Advanced Beginner
    Windows 7 64bit Access 2013
    Join Date
    Mar 2014
    Posts
    42
    Oops sorry forgot that part

    SELECT OUTBOUND.[SELECT], OUTBOUND.SHIPPER, OUTBOUND.GBL, OUTBOUND.RDD, OUTBOUND.GROSS, OUTBOUND.CUBE, OUTBOUND.[PCS X OF], OUTBOUND.[TOTAL PCS], OUTBOUND.SCAC, OUTBOUND.REMARKS, OUTBOUND.[CONT#], OUTBOUND.VESSEL, OUTBOUND.VOYAGE, OUTBOUND.TO, OUTBOUND.FROM, OUTBOUND.[SEAL#], OUTBOUND.ETD, OUTBOUND.ETA, OUTBOUND.[CUT OFF], OUTBOUND.SIZE, OUTBOUND.SHIPLINE, OUTBOUND.[ALSO NOTIFY], OUTBOUND.[BK#], OUTBOUND.NET, [INTERNATIONAL CARRIER].[CARRIER NAME], [Copy Of Consignee].ConsigneeName, [CONSIGNEE ADDRESSES].[Address 1], [CONSIGNEE ADDRESSES].[Address 2], [CONSIGNEE ADDRESSES].[Address 3], [CONSIGNEE ADDRESSES].City, [CONSIGNEE ADDRESSES].State, [CONSIGNEE ADDRESSES].Field1, [CONSIGNEE ADDRESSES].PostalCode, [CONSIGNEE ADDRESSES].WorkPhone, OUTBOUND.[ETA PORT], OUTBOUND.[ETD PORT]
    FROM ((OUTBOUND INNER JOIN [INTERNATIONAL CARRIER] ON OUTBOUND.SCAC = [INTERNATIONAL CARRIER].SCAC) INNER JOIN [Copy Of Consignee] ON (OUTBOUND.TO = [Copy Of Consignee].Country) AND (OUTBOUND.SCAC = [Copy Of Consignee].SCAC)) LEFT JOIN [CONSIGNEE ADDRESSES] ON [Copy Of Consignee].ConsigneeName = [CONSIGNEE ADDRESSES].ConsigneeName
    WHERE (((OUTBOUND.[SELECT])=True));

  6. #6
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,849
    My first thought was to use an immediate iif statement, But I don't know how your recordsource fields map to your form.
    Here's info on IIF
    Which field in the recordsource goes to which field in the report?

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

Similar Threads

  1. Replies: 5
    Last Post: 02-07-2014, 11:57 AM
  2. Replies: 3
    Last Post: 04-22-2013, 06:08 AM
  3. Replies: 1
    Last Post: 12-07-2012, 02:14 AM
  4. Replies: 1
    Last Post: 03-03-2012, 10:17 PM
  5. Replies: 16
    Last Post: 07-22-2011, 09:23 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