nayuda no consigo borrar registros
Publicado por lorenzo medinagarcia (9 intervenciones) el 04/09/2007 23:31:18
No consigo borrar registros de una base de datos, el codigo que utilizo es el siguiente, creo que el problema esta en la forma de capturar datos en los "Text", pero la verdad no encuentro el fallo, ayudenme por favor
el campo fechadelacita en la BD estan con fecha/hora.
lo datos se introducen en los text, y estos son los codigos
indiPrivate Sub Text5_KeyPress(KeyAscii As Integer)
Const Number$ = "0123456789." ' only allow these characters
If KeyAscii <> 8 Then
If InStr(Number$, Chr(KeyAscii)) = 0 Then
KeyAscii = 0
Exit Sub
End If
End If
If Len(Text5) = 2 Or Len(Text5) = 5 Then
Text5 = Text5 & "/"
Text5.SelStart = Len(Text5)
End If
End Sub
Private Sub Text6_KeyPress(KeyAscii As Integer)
Const Number$ = "0123456789." ' only allow these characters
If KeyAscii <> 8 Then
If InStr(Number$, Chr(KeyAscii)) = 0 Then
KeyAscii = 0
Exit Sub
End If
End If
If Len(Text6) = 2 Or Len(Text6) = 5 Then
Text6 = Text6 & "/"
Text6.SelStart = Len(Text6)
End If
End Sub
declarion de variable:
public dbtest as Dao.database
y cuando puo en el boto para borrar los registro el siguiente codigo:
Set dbTest = OpenDatabase("c:\manosbellas.mdb")
dbTest.Execute "Delete From citas Where diadelafecha Between #" & Text5 & "# And #" & Text6 & "#" , te ruego me digas si ves el error,
si alguien tiene algun ejemplo y me lo puede enviar se lo agradecera eternqmente. mi e-mail " [email protected]"
un saludo y perdonad lo torpe que soy pero no veo el error. gracias
Lorenzo Medna Garcia
el campo fechadelacita en la BD estan con fecha/hora.
lo datos se introducen en los text, y estos son los codigos
indiPrivate Sub Text5_KeyPress(KeyAscii As Integer)
Const Number$ = "0123456789." ' only allow these characters
If KeyAscii <> 8 Then
If InStr(Number$, Chr(KeyAscii)) = 0 Then
KeyAscii = 0
Exit Sub
End If
End If
If Len(Text5) = 2 Or Len(Text5) = 5 Then
Text5 = Text5 & "/"
Text5.SelStart = Len(Text5)
End If
End Sub
Private Sub Text6_KeyPress(KeyAscii As Integer)
Const Number$ = "0123456789." ' only allow these characters
If KeyAscii <> 8 Then
If InStr(Number$, Chr(KeyAscii)) = 0 Then
KeyAscii = 0
Exit Sub
End If
End If
If Len(Text6) = 2 Or Len(Text6) = 5 Then
Text6 = Text6 & "/"
Text6.SelStart = Len(Text6)
End If
End Sub
declarion de variable:
public dbtest as Dao.database
y cuando puo en el boto para borrar los registro el siguiente codigo:
Set dbTest = OpenDatabase("c:\manosbellas.mdb")
dbTest.Execute "Delete From citas Where diadelafecha Between #" & Text5 & "# And #" & Text6 & "#" , te ruego me digas si ves el error,
si alguien tiene algun ejemplo y me lo puede enviar se lo agradecera eternqmente. mi e-mail " [email protected]"
un saludo y perdonad lo torpe que soy pero no veo el error. gracias
Lorenzo Medna Garcia
Valora esta pregunta


0