i am just newbee in VB
>i cr8ed a project with Data control linked to MS access
>Everything is working fine but the delete Button
it giving me error if last record is deleted
> So i need 2 prevent the deletion of last access data
How i coded =
1)
Private Sub Command4_Click()
Data1.Recordset.Delete
End Sub
2)
Private Sub Command4_Click()
If Data1.Recordset.RecordCount >= 1 Then
Data1.Recordset.Delete
Data1.Refresh
End If
End Sub
3)
Private Sub Command4_Click()
data1.recordset.delete
if not data1.recordset.bof then
data1.recordset.moveprevious
elseif not data1.recordset.eof then
data1.recordset.movenext
else
msgbox"last Record"
end if
end sub
All these methods not working
Can any 1 pls tell me how to solve this problem .if possible with sample code
thanku vm
>i cr8ed a project with Data control linked to MS access
>Everything is working fine but the delete Button
it giving me error if last record is deleted
> So i need 2 prevent the deletion of last access data
How i coded =
1)
Private Sub Command4_Click()
Data1.Recordset.Delete
End Sub
2)
Private Sub Command4_Click()
If Data1.Recordset.RecordCount >= 1 Then
Data1.Recordset.Delete
Data1.Refresh
End If
End Sub
3)
Private Sub Command4_Click()
data1.recordset.delete
if not data1.recordset.bof then
data1.recordset.moveprevious
elseif not data1.recordset.eof then
data1.recordset.movenext
else
msgbox"last Record"
end if
end sub
All these methods not working
Can any 1 pls tell me how to solve this problem .if possible with sample code
thanku vm