Results 1 to 4 of 4

Calculated Field?? Replacement cost for device type and with specified replacement device

  1. #1
    awinterton is offline Novice
    Windows 10 Access 2016
    Join Date
    Sep 2017
    Posts
    3

    Calculated Field?? Replacement cost for device type and with specified replacement device


    I have a table that is "DeviceType". This table is a list of device types, initial cost, replacement device, and a calculated field for replacement cost.

    ID DeviceType InitialCost ReplacementDevice ReplacementCost
    1 NUC 700 700
    2 Stick 550 NUC 700
    3 OPS 1200 1200
    4 Tiny 1200 NUC 700


    DeviceType is text
    InitialCost is currency
    ReplacementDevice is lookupfield to devicetype
    replacementcost is calculated field.

    My question is regarding the calculated field. Since I'm specifying the replacement device type for any particular device, I want the replacement cost to either reflect the initial cost if no replacement device is selected, or the initial cost of whatever the selected replacement device is.

    Currently my calculated field expression is IIf(IsNull([ReplacementPlayer]),[InitialCost],??). The question marks are where I'm stuck. I don't know how to look up the initial cost of the selected replacement device. Any suggestions?

  2. #2
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    17,338
    DLookup() would be one way, though I have no idea if they work in a calculated field (I don't use them).

    DLookup Usage Samples
    Paul (wino moderator)
    MS Access MVP
    www.BaldyWeb.com

  3. #3
    awinterton is offline Novice
    Windows 10 Access 2016
    Join Date
    Sep 2017
    Posts
    3
    Quote Originally Posted by pbaldy View Post
    DLookup() would be one way, though I have no idea if they work in a calculated field (I don't use them).

    DLookup Usage Samples
    If I scratch the calculated field (a quick search shows most people avoid them) is there a better method?

  4. #4
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    17,338
    Paul (wino moderator)
    MS Access MVP
    www.BaldyWeb.com

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

Similar Threads

  1. Replies: 1
    Last Post: 01-18-2015, 07:12 PM
  2. Replies: 6
    Last Post: 01-17-2014, 09:37 AM
  3. Updating a database from mobile device?
    By MisterFalck in forum Access
    Replies: 2
    Last Post: 05-06-2013, 09:54 AM
  4. Access as Default Program for Device
    By Meep in forum Forms
    Replies: 1
    Last Post: 04-13-2012, 09:40 AM
  5. Replies: 0
    Last Post: 04-23-2009, 08:42 AM

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
  •  
Tech Forums: Microsoft Office Forums