1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Help with access form (insert table value into form field)

Discussion in 'Business Applications' started by Mhouser, Apr 10, 2009.

Thread Status:
Not open for further replies.
Advertisement
  1. Mhouser

    Mhouser Thread Starter

    Joined:
    Jan 21, 2008
    Messages:
    138
    Here is what I'm trying to do.

    For lists Equipment in drop down box.
    Whatever equipment that is select, the equipment type field needs to be updated from a table.

    Is there a way to get a value from SQL statement?

    SQL = "SELECT [Equipment Type] FROM OrderDetails Where " _
    & " Equipment = '" & Me.Equipment & "'"
    [Forms]![OrderDetails]![Equipment Type] = SQL
     
  2. OBP

    OBP

    Joined:
    Mar 8, 2005
    Messages:
    19,895
    Mhouser, if you are trying to "display" a value related to the Combo selection you can have thta value as an extra column in the combo and refer to it with simple VBA.
    You should not populate a Field's actual value with that from the combo as that is duplication.
    Can you tell me which one you are trying to do?
     
  3. Mhouser

    Mhouser Thread Starter

    Joined:
    Jan 21, 2008
    Messages:
    138
    This is close to what I want to happen.

    Me.Equipment_Type =DLookup("EquipmentType","Equipment","Equipment = " & Me.Equipment)

    But this returns a Null Value

    I'll do as you suggest and place both columns into the combo box.
     
  4. Mhouser

    Mhouser Thread Starter

    Joined:
    Jan 21, 2008
    Messages:
    138
    Don't know how this works. It's doing exactly what I want when I place both columns in the combo box.

    On Equipment field change event:
    Me.Equipment_Type = Me.Equipment
     
As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/817548

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice