yapmak istediğim listbox da istenen isme tıklandığında excelde formun o kişinin bilgileriyle dolması fakat çalışmıyo.. ilginiz için teşekürler
Private Sub ListBox1_Click()
TC_SEC = ListBox1.Column(2)
Dim sql As String
sql = "select * from[Liste$] where TC_SEC like '" & TCNO & "*' ' "
Call bul(sql)
End Sub
Private Sub bul(sql As String)
Dim MyDB As DAO.Database
Dim RS As DAO.Recordset
Dim RScount As Long
On Error GoTo ErrHandler:
Set MyDB = OpenDatabase(DBpath, False, False, "Excel 8.0")
Set RS = MyDB.OpenRecordset(sql)
Sheets("Sheet1").Range("A1") = RS("Isim")
RS.Close
MyDB.Close
Set RS = Nothing
Set MyDB = Nothing
End Sub
Private Sub ListBox1_Click()
TC_SEC = ListBox1.Column(2)
Dim sql As String
sql = "select * from[Liste$] where TC_SEC like '" & TCNO & "*' ' "
Call bul(sql)
End Sub
Private Sub bul(sql As String)
Dim MyDB As DAO.Database
Dim RS As DAO.Recordset
Dim RScount As Long
On Error GoTo ErrHandler:
Set MyDB = OpenDatabase(DBpath, False, False, "Excel 8.0")
Set RS = MyDB.OpenRecordset(sql)
Sheets("Sheet1").Range("A1") = RS("Isim")
RS.Close
MyDB.Close
Set RS = Nothing
Set MyDB = Nothing
End Sub