Hi, I hope someone can help. I have created a listbox and populated this with specific information from an access database. When the data is populated some of the text is too long for the list box. I would like the user to select the required data and then once selected a new form appears with the text in full, for example, the user clicks on the asset name and it shows the following info in a sep. form: Asset Name, Description, owner etc etc. I have created the new form with the labels and text boxes, but I'm not sure how to code this. Hopefully someone out there can shed some light on this problem.
Code for current Form, which extracts data from Access Database
CODE
Private Sub cmdPopulate_Click()
Dim myConnection As Connection
Dim strConnection As String
Dim myData As New Recordset
Dim strSQL As String
Dim lbItem As Integer
Me.lbAssets.ColumnCount = 6
lbItem = 0
'This line defines the connection string
strConnection = "Provider=MSDAORA.1;Password=Arpprd123;User ID=READONLY;Data Source=APORTP1;Persist Security Info=True"
'This line defines the SQL command
strSQL = "select ASSETNAME, ASSETDISPLAYNAME, EXTERNALAPPID, STDNAME, DESCRIPTION, OWNERGUID from SIMSUPP.ADR_ASSETWITHSTD ORDER BY ASSETNAME"
myData.Open strSQL, strConnection, adOpenForwardOnly
'here we read the data
Do Until myData.EOF = True
With Me.lbAssets
.AddItem
.List(lbItem, 0) = myData![ASSETNAME] & ""
.List(lbItem, 1) = myData![ASSETDISPLAYNAME] & ""
.List(lbItem, 2) = myData![ExternalAppID] & ""
.List(lbItem, 3) = myData![STDNAME] & ""
.List(lbItem, 4) = myData![Description] & ""
.List(lbItem, 5) = myData![OWNERGUID] & ""
End With
lbItem = lbItem + 1
myData.MoveNext
Loop
myData.Close
Set myData = Nothing
Set myConnection = Nothing
End Sub
Mod edit - Added code tags.