Ver Mensaje Individual
  #13 (permalink)  
Antiguo 07/08/2008, 12:37
Avatar de yochy20
yochy20
 
Fecha de Ingreso: julio-2008
Mensajes: 32
Antigüedad: 16 años, 9 meses
Puntos: 0
Pregunta Respuesta: Sentencia Sql

Mejor te dejo todo mi codigo haber si puedes encontrar q es lo q esta mal


Dim TBE2 As Database
Dim reg As Recordset
Dim lista As ListItem
Dim DbTBE2 As DAO.Database
Dim RStingreso As DAO.Recordset

Private Sub Command1_Click()
reg.AddNew
reg!fecha = Text1.Text
reg!guia = Text2.Text
reg!proveedor = Text3.Text
reg!cantidad = Text4.Text
reg!devolucion = Text5.Text
reg!farmacia = text6.Text
reg!trapi = Text7.Text
reg!vivanco = Text8.Text
reg!crucero = Text9.Text
reg!cayurruca = Text10.Text
reg!mantilhue = Text11.Text
reg!futahuente = Text12.Text
reg!carimallin = Text13.Text
reg!sector1 = Text14.Text
reg!sector2 = Text15.Text
reg!sector3 = Text16.Text
reg!procedimiento = Text17.Text
reg!clinicasdentales1 = Text18.Text
reg!ira = Text19.Text
reg!era = Text20.Text
reg!salamotora = Text21.Text
reg!prestamos = Text22.Text
reg!saldo = Text23.Text
reg!inventario = Text24.Text
reg!clinicasdentales2 = Text25.Text
reg!clinicasdentales3 = Text26.Text
reg!clinicasdentales4 = Text27.Text
reg!codigo = Text28.Text
reg!medicamento = Text29.Text
reg.Update

Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Text9.Text = ""
Text10.Text = ""
Text11.Text = ""
Text12.Text = ""
Text13.Text = ""
Text14.Text = ""
Text15.Text = ""
Text16.Text = ""
Text17.Text = ""
Text18.Text = ""
Text19.Text = ""
Text20.Text = ""
Text21.Text = ""
Text22.Text = ""
Text23.Text = ""
Text24.Text = ""
Text25.Text = ""
Text26.Text = ""
Text27.Text = ""
Text28.Text = ""
Text29.Text = ""

Text28.SetFocus

End Sub

Private Sub Command2_Click()
reg.Delete
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Text9.Text = ""
Text10.Text = ""
Text11.Text = ""
Text12.Text = ""
Text13.Text = ""
Text14.Text = ""
Text15.Text = ""
Text16.Text = ""
Text17.Text = ""
Text18.Text = ""
Text19.Text = ""
Text20.Text = ""
Text21.Text = ""
Text22.Text = ""
Text23.Text = ""
Text24.Text = ""
Text25.Text = ""
Text26.Text = ""
Text27.Text = ""
Text28.Text = ""
Text29.Text = ""

Text28.SetFocus
End Sub

Private Sub Command3_Click()
Text23.Text = Val(text6.Text) + Val(Text7.Text) + Val(Text8.Text) + Val(Text9.Text) + Val(Text10.Text) + Val(Text11.Text) + Val(Text12.Text) + Val(Text13.Text) + Val(Text14.Text) + Val(Text15.Text) + Val(Text16.Text) + Val(Text17.Text) + Val(Text18.Text) + Val(Text19.Text) + Val(Text20.Text) + Val(Text21.Text) + Val(Text22.Text) + Val(Text25.Text) + Val(Text26.Text) + Val(Text27.Text)

Text24.Text = Val(text6.Text) + Val(Text7.Text) + Val(Text8.Text) + Val(Text9.Text) + Val(Text10.Text) + Val(Text11.Text) + Val(Text12.Text) + Val(Text13.Text) + Val(Text14.Text) + Val(Text15.Text) + Val(Text16.Text) + Val(Text17.Text) + Val(Text18.Text) + Val(Text19.Text) + Val(Text20.Text) + Val(Text21.Text) + Val(Text22.Text) + Val(Text25.Text) + Val(Text26.Text) + Val(Text27.Text)

End Sub

Private Sub Command4_Click()
Text23.Text = Val(text6.Text) - Val(Text7.Text) - Val(Text8.Text) - Val(Text9.Text) - Val(Text10.Text) - Val(Text11.Text) - Val(Text12.Text) - Val(Text13.Text) - Val(Text14.Text) - Val(Text15.Text) - Val(Text16.Text) - Val(Text17.Text) - Val(Text18.Text) - Val(Text19.Text) - Val(Text20.Text) - Val(Text21.Text) - Val(Text22.Text) - Val(Text25.Text) - Val(Text26.Text) - Val(Text27.Text)

Text24.Text = Val(text6.Text) - Val(Text7.Text) - Val(Text8.Text) - Val(Text9.Text) - Val(Text10.Text) - Val(Text11.Text) - Val(Text12.Text) - Val(Text13.Text) - Val(Text14.Text) - Val(Text15.Text) - Val(Text16.Text) - Val(Text17.Text) - Val(Text18.Text) - Val(Text19.Text) - Val(Text20.Text) - Val(Text21.Text) - Val(Text22.Text) - Val(Text25.Text) - Val(Text26.Text) - Val(Text27.Text)

End Sub

Private Sub Command5_Click()
Unload Me
End Sub

Private Sub Command6_Click()
Data1.UpdateRecord
End Sub

Private Sub Command7_Click()
FILTRO = "SELECT * FROM ingresos WHERE Codigo = #" & Format(Text30.Text, "mm/dd/yyyy") & "# ORDER BY Fecha"
Set RStingreso = DbTBE2.OpenRecordset(FILTRO, dbOpenDynaset)

Set lista = ListView1.ListItems.Add(, , "")
lista.SubItems(1) = ""
lista.SubItems(2) = ""
lista.SubItems(3) = ""
lista.SubItems(4) = ""
lista.SubItems(5) = ""
lista.SubItems(6) = ""
lista.SubItems(7) = ""
lista.SubItems(8) = ""
lista.SubItems(9) = ""
lista.SubItems(10) = ""
lista.SubItems(11) = ""
lista.SubItems(12) = ""
lista.SubItems(13) = ""
lista.SubItems(14) = ""
lista.SubItems(15) = ""
lista.SubItems(16) = ""
lista.SubItems(17) = ""
lista.SubItems(18) = ""
lista.SubItems(19) = ""
lista.SubItems(20) = ""
lista.SubItems(21) = ""
lista.SubItems(22) = ""
lista.SubItems(23) = ""
lista.SubItems(24) = ""
lista.SubItems(25) = ""
lista.SubItems(26) = ""
lista.SubItems(27) = ""
lista.SubItems(28) = ""
lista.SubItems(29) = ""

Set lista = ListView1.ListItems.Add(, , "")
lista.SubItems(1) = ""
lista.SubItems(2) = ""
lista.SubItems(3) = ""
lista.SubItems(4) = ""
lista.SubItems(5) = ""
lista.SubItems(6) = ""
lista.SubItems(7) = ""
lista.SubItems(8) = ""
lista.SubItems(9) = ""
lista.SubItems(10) = ""
lista.SubItems(11) = ""
lista.SubItems(12) = ""
lista.SubItems(13) = ""
lista.SubItems(14) = ""
lista.SubItems(15) = ""
lista.SubItems(16) = ""
lista.SubItems(17) = ""
lista.SubItems(18) = ""
lista.SubItems(19) = ""
lista.SubItems(20) = ""
lista.SubItems(21) = ""
lista.SubItems(22) = ""
lista.SubItems(23) = ""
lista.SubItems(24) = ""
lista.SubItems(25) = ""
lista.SubItems(26) = ""
lista.SubItems(27) = ""
lista.SubItems(28) = ""
lista.SubItems(29) = ""

End Sub

Private Sub Command8_Click()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Text9.Text = ""
Text10.Text = ""
Text11.Text = ""
Text12.Text = ""
Text13.Text = ""
Text14.Text = ""
Text15.Text = ""
Text16.Text = ""
Text17.Text = ""
Text18.Text = ""
Text19.Text = ""
Text20.Text = ""
Text21.Text = ""
Text22.Text = ""
Text23.Text = ""
Text24.Text = ""
Text25.Text = ""
Text26.Text = ""
Text27.Text = ""
Text28.Text = ""
Text29.Text = ""
Text30.Text = ""
End Sub

Private Sub Form_Load()

Set DbTBE2 = OpenDatabase(App.Path & "\TBE2.mdb", True, False, ";pwd=" & "TuPassword")
Set reg = DbTBE2.OpenRecordset("ingresos", dbOpenDynaset)

End Sub

Private Sub Text1_Keypress(keyascii As Integer)
If keyascii = 13 Then
reg.FindFirst "codigo='" & Text28.Text & "'"

If reg.NoMatch Then
MsgBox "no existe"
Text2.SetFocus
Else
Text1.Text = reg!fecha
Text2.Text = reg!guia
Text3.Text = reg!proveedor
Text4.Text = reg!cantidad
Text5.Text = reg!devolucion
text6.Text = reg!farmacia
Text7.Text = reg!trapi
Text8.Text = reg!vivanco
Text9.Text = reg!crucero
Text10.Text = reg!cayurruca
Text11.Text = reg!mantilhue
Text12.Text = reg!futahuente
Text13.Text = reg!carimallin
Text14.Text = reg!sector1
Text15.Text = reg!sector2
Text16.Text = reg!sector3
Text17.Text = reg!procedimiento
Text18.Text = reg!clinicasdentales1
Text19.Text = reg!ira
Text20.Text = reg!era
Text21.Text = reg!salamotora
Text22.Text = reg!prestamos
Text23.Text = reg!saldo
Text24.Text = reg!inventario
Text25.Text = reg!clinicasdentales2
Text26.Text = reg!clinicasdentales3
Text27.Text = reg!clinicasdentales4
Text28.Text = reg!codigo
Text29.Text = reg!medicamento

End If
End If
End Sub

haber si lo entiendes

muxas gracias