Private Sub cmdDelet_Click()
If List1.ListCount = 0 Then Exit Sub
Dim X As String
X = List1.Text
Adodc1.RecordSource = "select * from thenote where note ='" & List1.Text & "'"
    Adodc1.Refresh
Adodc1.CursorLocation = adUseServer
Adodc1.Recordset.Open
If Adodc1.Recordset.RecordCount > 0 Then
Adodc1.Recordset.Delete adAffectCurrent
    MsgBox "E? C????"
    List1.Clear
    Else
    Exit Sub
    End If
Adodc1.RecordSource = "select * from thenote where note "
    Adodc1.Refresh

If Adodc1.Recordset.RecordCount > 0 Then
Adodc1.Recordset.MoveFirst
List1.Clear
Do While Not Adodc1.Recordset.EOF
List1.AddItem Adodc1.Recordset!note
Adodc1.Recordset.MoveNext
Loop
Adodc1.Recordset.MoveFirst
End If

'''''''''''''''''''''''''''''''''
Exit Sub
MsgBox "E?E ????E C???? E??C?"

End Sub

Private Sub cmdSave_Click()
On Error Resume Next
If TxtNote = "" Then
MsgBox "?II? C?E?C?CE ?? ????"
Else
Adodc1.Recordset.AddNew
Adodc1.Recordset.Fields("note") = TxtNote.Text
Adodc1.Recordset.Update
frmMasg.lab.Caption = "?C?? ??U C???C?UE"
frmMasg.Show
'''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''
Call list
TxtNote = ""
End If

End Sub

Private Sub Form_Load()
Me.Top = (Screen.Height - Me.Height) / 2
Me.Left = (Screen.Width - Me.Width) / 2
''''''''
''''''''''''''''
Dim sConnect As String
Dim FileSource As String
FileSource = App.Path & "\data.mdb;Persist Security Info=False;Jet OLEDB:Database Password=987"

sConnect = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
        "Data Source= " & FileSource & ""
''''''''''''''''''''''
''''''''''''''''
Adodc1.ConnectionString = sConnect
Adodc1.RecordSource = "thenote" '''''C?E?C?? ?? ?I?? C?????E
Adodc1.Refresh
''''''''''''''''''''''''''''''
Call list
End Sub
Private Sub list()
Adodc1.Recordset.MoveFirst
List1.Clear
Do While Not Adodc1.Recordset.EOF
List1.AddItem Adodc1.Recordset.Fields("note")
Adodc1.Recordset.MoveNext
Loop

End Sub


Private Sub List1_Click()
 Dim namex As String
 
  namex = Trim(List1.list(List1.ListIndex))
  TxtNote = "  " & namex & "  "
If Adodc1.Recordset.EOF = False Then
  
      TxtNote = Adodc1.Recordset.Fields("note")
    
     
        End If

End Sub

Private Sub List1_dblClick()
If List1.ListCount = 0 Then Exit Sub
Dim zz As String
zz = List1.Text

Adodc1.RecordSource = "select * from thenote where note ='" & List1.Text & "'"
    Adodc1.Refresh

If Adodc1.Recordset.RecordCount > 0 Then
Adodc1.Recordset.Delete ' adAffectCurrent
    MsgBox "E? C????"
    List1.Clear
    Else
    Exit Sub
    End If
Adodc1.RecordSource = "select * from thenote where note "
    Adodc1.Refresh

If Adodc1.Recordset.RecordCount > 0 Then
Adodc1.Recordset.MoveFirst
List1.Clear
Do While Not Adodc1.Recordset.EOF
List1.AddItem Adodc1.Recordset!note
Adodc1.Recordset.MoveNext
Loop
Adodc1.Recordset.MoveFirst
End If

'''''''''''''''''''''''''''''''''
Exit Sub
End Sub
''''''''''''''''
Grado3 2009 
