Your SlideShare is downloading. ×
Formulario Para Los Vendedores
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Introducing the official SlideShare app

Stunning, full-screen experience for iPhone and Android

Text the download link to your phone

Standard text messaging rates apply

Formulario Para Los Vendedores

1,127
views

Published on

Published in: Travel, Business

0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
1,127
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
31
Comments
0
Likes
2
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Formulario para los vendedores CODIFICACIÓN En la declaración general de formulario Option Explicit Dim cn As ADODB.Connection Dim rsVendedores As ADODB.Recordset En el formulario mismo Private Sub Form_Load() Set cn = New ADODB.Connection Set rsVendedores = New ADODB.Recordset With cn .Provider = "Microsoft.Jet.OLEDB.4.0" .ConnectionString = "Data Source=d:sisventasdataventas.mdb" .Open End With rsVendedores.ActiveConnection = cn rsVendedores.Open "Select * from vendedores", cn, adOpenStatic, adLockOptimistic llenalista rsVendedores.MoveFirst txtCod_ven.Text = rsVendedores.Fields("cod_ven") txtVendedor.Text = rsVendedores.Fields("nombres") & ", " & rsVendedores.Fields("apellidos") txtDni.Text = rsVendedores.Fields("DNI") End Sub
  • 2. En el txtbus Vendedor Private Sub txtBus_Change() Dim cBus As String cBus = txtBus.Text Set rsVendedores = New Recordset rsVendedores.Open "select * from vendedor where nombres like'" + Trim(cBus) & "%" & "'", cn, adOpenStatic, adLockOptimistic llenalista End Sub En el ListView1 Private Sub ListView1_Click() Dim cCod_ven As String cCod_ven = ListView1.SelectedItem.Text rsVendedores.MoveFirst rsVendedores.Find "cod_ven='" + Trim(cCod_ven) + "'" txtCod_ven.Text = rsVendedores.Fields("cod_ven") txtVendedor.Text = rsVendedores.Fields("apellidos") & ", " & rsVendedores.Fields("nombres") txtDni.Text = rsVendedores.Fields("DNI") End Sub
  • 3. En el botón aceptar Private Sub cmdAceptar_Click() Dim cCod_ven As String cCod_ven = ListView1.SelectedItem.Text rsVendedores.MoveFirst rsVendedores.Find "cod_ven='" + Trim(cCod_ven) + "'" frm_Venta.txtCod_ven = rsVendedores.Fields("cod_ven") frm_Venta.txtVendedor = rsVendedores.Fields("nombres") & " " & rsVendedores.Fields("apellidos") frm_Venta.Show Unload Me End Sub En el botón cancelar Private Sub cmdCancelar_Click() frm_Venta.Show Unload Me End Sub Otras codificaciones del formulario Private Sub llenalista() ListView1.ListItems.Clear Dim nuevo As ListItem Dim i As Integer For i = 1 To rsVendedores.RecordCount Set nuevo = ListView1.ListItems.Add(, , rsVendedores.Fields("cod_ven")) nuevo.SubItems(1) = rsVendedores.Fields("nombres") & " " & rsVendedores.Fields("apellidos") nuevo.SubItems(2) = rsVendedores.Fields("DNI") rsVendedores.Move (1) Next i End Sub