- Код: Выделить всё
Private Sub Command1_Click()
Dim db As Database
Dim rs As Recordset
Dim strCity As String
strCity = "1"
Set db = OpenDatabase("c:\Baza.mdb")
Set rs = db.OpenRecordset("SELECT * FROM [Abonents] WHERE [id] = " & Quote(strCity))
Do Until rs.EOF
lst.AddItem rs.Fields("id") & vbCrLf
rs.MoveNext
Loop
rs.Close
Set rs = Nothing
db.Close
Set db = Nothing
End Sub
Private Function Quote(strVariable As String) As String
Quote = " ' " & strVariable & " ' "
End Function
почему то не выводит в листбокс, помогие, почему не выводит, не врублюсь