You need to use the Combobox.Listindex property to determine which customer was selected -
'After opening your recordset and connection UNDER your combo click event, the following...
Dim xIndex As Integer
xIndex = Combo1.ListIndex
rs.AbsolutePosition = xIndex 'This will move to the correct recordset
Text1.Text = rs!YourFieldNameHere 'Text is added, close recordset
rs.Close
AndreRet
Senior Poster
3,922 posts since Jan 2008
Reputation Points: 334
Solved Threads: 350
Are you using a data control or adodb (code)
AndreRet
Senior Poster
3,922 posts since Jan 2008
Reputation Points: 334
Solved Threads: 350
I would rather use adodb code, do you know how to achieve this?
AndreRet
Senior Poster
3,922 posts since Jan 2008
Reputation Points: 334
Solved Threads: 350
By using a combobox, you will only be able to add whatever is in the combo box text. If you have multiple fields, you will hjave to use text boxes to add.
Have a look at THIS thread that gives you all the connection, add, edit etc code. Just remember that the connection code is for ms sql 2000. If you are using access, the connection will differ. To get the correct connection, have a look at this link. Just select "Access" from the available options, and use the one that you will need.
AndreRet
Senior Poster
3,922 posts since Jan 2008
Reputation Points: 334
Solved Threads: 350