Main Form = frmManageBids
Sub Form = sfrmBidInProcess (Datasheet)
Sub Form Row Source = qryBidInProcess
qryBidInProcess Row Source = tblBidLog (PK = BidNum)
1. User selects record (Bid Number) on Sub Form
2. User clicks "Delete Bid" command button (currently located on the subform)
3. Selected Bid Number is deleted from tblBidLog
4. Requery subform results
The current code results in prompt asking if I am sure I want to delete a row from the requested table. This prompt appears regardless of which answer (yes or no) I choose in the "delete confirmation" msgbox.
Private Sub cmdDeleteInProcess_Click()
Dim iCount As Integer
iCount = DCount("*", "qryBidInProcess")
If iCount = 0 Then
MsgBox "There are currently no bids in process."
If IsNull(Me.sfrmBidInProcess.Form.BidNumber) Then
MsgBox "Please select a bid number."
MsgBox "Are you sure you want to DELETE Bid # " & Me.sfrmBidInProcess.Form.BidNumber & "?", vbYesNo, "Delete Confirmation"
If vbYes Then DoCmd.RunSQL ("Delete * from tblBidLog where BidNum = " & Me.sfrmBidInProcess.Form.BidNumber & ";")