We help IT Professionals succeed at work.

easy question

adk77
adk77 asked
on
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.

Comment
Watch Question

Billing Engineer
CERTIFIED EXPERT
Most Valuable Expert 2014
Top Expert 2009
Commented:
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
wend

to know the pk of the selected row:
listbox1.ItemData(listbox1.ListIndex)

Same for listbox2...

CHeers

Commented:
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.
http://www.experts-exchange.com/jsp/qList.jsp?ta=commspt

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.
http://www.experts-exchange.com/jsp/cmtyHelpDesk.jsp


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.

 

Commented:
My following recommended disposition:

Points to angelIII

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

guidway
EE Cleanup Volunteer


Per recommendation, force-accepted.

Netminder
CS Moderator

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