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

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

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
 

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?
 

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.
 

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
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

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 807,865 other people just like you!

Latest posts

Staff online

Top