Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Action based on 1

Status
Not open for further replies.

enigma12121

Programmer
Jul 16, 2001
6
US
Here's the set up.
Right now I have a drop-down box, that contains Part numbers that are in a certain Sales Order. Those part numbers are listed in tblPart, with a part type. Is there anyway that I can easly find out the parttype with just the part number. I need to be able to so differnt actions for differnt part types.
 
The query that you use to fill the drop-down box, add the second field to it. In your properties of the drop-down, set the width for the second field to 0" if you don't want to see it. Then you have access to the part type for the part number that gets selected. Terry M. Hoey
 
how can I write the sql query to only include the part numbers of the parts that are in the SO

right now this is the SQL behind the brop down box

SELECT [tblSODetail].[Part_ID] FROM tblSODetail WHERE [tblSODetail].[SO_Num]= (What ever the SO number is)

Also will this work for list boxes, since I hope to convert this over to a list box in the future.
 
I forgot to mention to set the BoundColumn property for the drop down to the column that has the parttype, or the second column.

How are you getting the SO number from the user? A textbox on a form? If so, your query to load the drop down should be something like:

SELECT [tblPart].[Part_ID], [tblPart].[Part_Type] FROM tblPart WHERE [tblSODetail].[Part_ID] = FormName.TextBoxName;

That should fill your drop-down if you put it in the On Lost Focus event property of your textbox. Then, if you set the bound column of the drop down to 2 as I mentioned, when the user selects a part number from the drop-down, you should have the value for the part-type.

I didn't test any of this, but am going from memory and glancing at my Access 97 Developer's Handbook by Litwin, Getz and Gilbert (SYBEX), a Bible in my eyes...

Hope it helps... Terry M. Hoey
 
But that would fill the list box with every thing in the So Deatil table not just the ones for the particular so I want.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top