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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dexterity - Drop down list 1

Status
Not open for further replies.

celeron895

Programmer
Jan 29, 2002
81
0
0
US
I am using a pass-through sql statement to select an id and name from a table and populate the contents of a drop down list with a list of the names. (select id, name from table)

After selecting a name in the drop down box, I need to populate another field on the form with the id that corresponds to the name selected.

I can do this task by creating another pass-through sql statement (select id from table where name = name selected), but that seems silly since I can select it with my initial statement.

I don't think Dexterity has the data structure that I need to perform this lookup. Any ideas?

 
If the ID is an integer or long integer you can add that to the the drop down list as you add the names. Then you can retrieve it with the itemdata() function.

Otherwise the "trick" is to populate a hidden list of IDs at the same time as you populate the list of Names. By looking at the hidden list for the position of the selected name, you can obtain the ID. This method is used in a number of places within GP.

David Musgrave [MSFT]
Senior Development Consultant
Escalation Engineer
MBS Support - Asia Pacific

Microsoft Business Solutions

Any views contained within are my personal views and
not necessarily Microsoft Business Solutions policy.
This posting is provided "AS IS" with no warranties,
and confers no rights.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top