请大家多多指教
这个是我做的一段删除DatdGrid控件一行记录的代码,请大家帮我看看有什么问题?
Private Sub cmdDelete_Click()
If frmGuestInfo.adoGuest.Recordset.EOF <> True And frmGuestInfo.adoGuest.Recordset.BOF <> True Then
With frmMDI.adoRoom.Recordset
If MsgBox("确认要删除当前记录吗?", vbYesNo + vbQuestion + vbDefaultButton2, "确认框") = vbYes Then
.Find "RoomNo='" & frmGuestInfo.adoGuest.Recordset!RoomNo & "'", , adSearchForward, 1
If Not .EOF Then '有就提示,然后退出
!RoomStatus = False
End If
With frmGuestInfo.adoGuest.Recordset
.Delete
End With
dtgGuestInfo.SetFocus
End If
End With
End If
End Sub