Hi,
Try This :
Dbase.Execute(Delete * from SalesTable where eDate = #" _
& Format(DTPicker1.Value,"dd-mm-yyyy") & "#")
OR
Dbase.Execute(Delete * from SalesTable where eDate = CDate('" _
& Format(DTPicker1.Value,"dd-mm-yyyy") & "')")
Regards
Veena
thank you veena for your help. it really helps me a lot on my project. if it is ok for you to ask another help about delete?
this is my problem. I have already an existing data on the database. If i were going to view the existing data it will display on the flexgrid. Now, i want to delete some data on the flex grid, unfortunately all having the same ProdCode will be deleted.
How will i going to delete the data on the database with only the highlighted data only found in the flex grid?
This is my code but it doesn't work and my UI.
Private Sub cmdDelete_Click()
Dim i As Integer
With Me.grd
Dbase.Execute ("Delete * from OrderTable where TransCode ='" & .TextMatrix(.Row, 0) & "'")
End With
With Me.grd
Dbase.Execute ("Delete * from PaymentTable where TransCode ='" & .TextMatrix(.Row, 0) & "'")
End With
With Me.grd
i = .Row
If i > 0 Then
While i < .Rows
If i < .Rows - 1 Then
.TextMatrix(i, 0) = .TextMatrix(i + 1, 0)
.TextMatrix(i, 1) = .TextMatrix(i + 1, 1)
.TextMatrix(i, 2) = .TextMatrix(i + 1, 2)
.TextMatrix(i, 3) = .TextMatrix(i + 1, 3)
.TextMatrix(i, 4) = .TextMatrix(i + 1, 4)
.TextMatrix(i, 5) = .TextMatrix(i + 1, 5)
i = i + 1
Else
.Rows = .Rows - 1
End If
Wend
End If
End With
OT.MoveFirst
Do Until OT.EOF
With OT
.Edit
!Amount = lblGrnTotal.Caption
.Update
End With
OT.MoveNext
Loop
PAY.MoveFirst
Do Until PAY.EOF
With PAY
.Edit
!Amount = lblGrnTotal.Caption
.Update
End With
PAY.MoveNext
Loop
Load Form16
Form16.Show
End Sub
regards;
Denine:icon_question: