We help IT Professionals succeed at work.

easy question

adk77 asked
I have 2 ListBoxes.  Both  contain data that are retrieved from database.  List1 displayed information from Table1 and List2 displayed information from Table2.  I have Table3 which is created because of many to many relationship between Table1 and Table2.  

Problem ?
     I want to insert the value of Table1 & Table2 ?s primary key into Table3.  List1 & List2 aren?t  displayed primary keys and also not included in query.  Anybody understand, pls respond asap.

Watch Question

Billing Engineer
Most Valuable Expert 2014
Top Expert 2009
If the primary keys of table1 and table2 are numeric, you can store them in the ItemData list of the listbox:

while not eof
  listbox1.addnew captionofrow1
  listbox1.ItemData (listbox1.Newindex) = pkofrow1

to know the pk of the selected row:

Same for listbox2...


Thank you for your interest in Expert’s Exchange. We hope that this information has assisted you in diagnosing your problem. Please award the experts who diligently helped you to find a solution (if any) or request a moderator to PAQ or delete this question. I will check back in seven days to see if a response was given. If not this will be turned over to a moderator for a decision. Thank you!

Your options are:

1. Accept a Comment As Answer (use the button next to the Expert's name).
2. Close the question if the information was not useful to you. You must tell the participants why you wish to do this, and allow for Expert response.
3. Ask Community Support to help split points between participating experts and include the details (expert name and point values to each).
4. Delete the question. Again, you must tell the other participants why you wish to do this, and only Moderators can take this action for you. Do not try to delete them directly if any comments exist, they will be pended and will not complete.

For special handling needs, please post a zero point question in the link below, include the question QID/link.

Please click this Help Desk link for Member Guidelines, Member Agreement and the Question/Answer process: Click you Member Profile to view your question history and keep them all current with updates as the collaboration effort continues.

PLEASE DO NOT AWARD THE POINTS TO ME. ------------> EXPERTS: Please leave any comments regarding this question here on closing recommendations if this item remains inactive another seven (7) days.


My following recommended disposition:

Points to angelIII

If you have any comment or objection to the recommendation, please leave it here.

EE Cleanup Volunteer

Per recommendation, force-accepted.

CS Moderator

Explore More ContentExplore courses, solutions, and other research materials related to this topic.