|
-
Oct 13th, 2000, 09:27 PM
#1
Thread Starter
New Member
pls help.....
i m doing a inventory system...using vb6, and ms access(for database)now my prb is donno how to delete certain data form database...
for example..... i got these stocks ...
A001
A002
A003
A004
A005
if i want to delete only from A002 to A004
and left A001 and A005 in database
how m i code this ....
******************************************************
Private Sub cmdDel_Click()
Dim DB As Database
Dim rec As Recordset
Dim reply
Dim f1 As String
Set DB = OpenDatabase("c:\inventory system\Inven.mdb")
Set rec = DB.OpenRecordset("Sales")
reply = MsgBox("Delete from " & cbStockCodeFrom & " until " & cbStockCodeTo & " ? ", vbYesNoCancel)
If reply = vbYes Then
Do
If f1 = ("{Sales.StockCode} >= " & cbStockCodeFrom.Text & _
" and {Sales.StockCode} <= " & cbStockCodeTo.Text & "") Then
rec.Delete
rec.MoveNext
If rec.EOF Then Exit Sub
End If
Loop
MsgBox ("Record is Deleted")
End If
End Sub
**************************************************
this is wat i have done so far...
i keep changing the code...until i got blur wat m i doing now...
i really need some help....
thankss alottt
swiss
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|