VB Code:
Private Sub lstTester_Click()
Dim Trs As New ADODB.Recordset
Dim cmdCommand As New ADODB.Command
Dim sql As String
Set cmdCommand.ActiveConnection = DBConn
cmdCommand.CommandType = adCmdText
sql = "select * from tblMachines"
cmdCommand.CommandText = sql
Set Trs = cmdCommand.Execute
Dim Machid As Integer
Machid = Val(Left(lstTester.Text, 1))
frmMachines.txtID.Text = Machid
frmMachines.Show
Unload Me
End Sub
i do have another problem tho, i can only do that once bc it says that it is already open so i need to add an if statement, only problem is, that i can't figure it out, any suggesttions?