Advertisement
exzeta

Códigos

Mar 17th, 2014
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. Private Sub Form_Load()
  3. Dim conn As String
  4. conn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Documents and Settings\Tania\Escritorio\Programas\1\Doctores.mdb;Persist Security Info=False"
  5. Adodc1.ConnectionString = conn
  6. Adodc1.RecordSource = "select * from Citas"
  7. Adodc1.Refresh
  8.  
  9. Combo1.AddItem "Alejandro"
  10. Combo1.AddItem "Karen"
  11. Combo1.AddItem "Matias"
  12. End Sub
  13.  
  14. Private Sub Command1_Click()
  15. If Text1.Text = "" Then
  16.    Exit Sub
  17. End If
  18. If Text2.Text = " " Then
  19.     Exit Sub
  20. End If
  21. If Text3.Text = " " Then
  22.     Exit Sub
  23. End If
  24. If Combo1.Text = "" Then
  25.     Exit Sub
  26. End If
  27. Adodc1.Recordset.AddNew
  28. Adodc1.Recordset!fecha = Text1.Text
  29. Adodc1.Recordset!paciente = Text2.Text
  30. Adodc1.Recordset!hora = Text3.Text
  31. Adodc1.Recordset!doctor = Combo1.Text
  32. Adodc1.Recordset.Update
  33. Text1.Text = " "
  34. Text2.Text = " "
  35. Text3.Text = " "
  36. Combo1.Text = " "
  37. Call orden
  38. End Sub
  39.  
  40. Private Sub orden()
  41. Picture1.Cls
  42. If Adodc1.Recordset.RecordCount > 0 Then
  43.    Adodc1.Recordset.MoveFirst
  44. End If
  45. With Adodc1.Recordset
  46. Do While Not Adodc1.Recordset.EOF
  47. Picture1.Print !fecha & " " & !paciente & "" & !hora & " " & !doctor & ""
  48. Adodc1.Recordset.MoveNext
  49. Loop
  50. End With
  51. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement