lookforsmt
Registered User.
- Local time
- Today, 21:39
- Joined
- Dec 26, 2011
- Messages
- 672
HI! all
I have button on form which when on-Click will trigger series of querydef and then execute the query. Between the querydef there is a popup msg box which will provide the count of transactions.
Above code is working fine but I need the popup msg box (Yes or No) to also display the count of the records deleted in the 2nd msgbox instead of showing in the 3rd msg box.
I have tried all the possible ways but unable to do this, can anyone help me in this
Thanks
I have button on form which when on-Click will trigger series of querydef and then execute the query. Between the querydef there is a popup msg box which will provide the count of transactions.
Code:
Private Sub cmd_Update_envbrcd_Click()
On Err Goto Park
Dim qdef As DAO.QueryDef
Dim rstenvbrcd As Recordset
Set qdef = CurrentDb.QueryDefs("14 Update envbrcdTochqbrcd")
qdef.Execute
MsgBox qdef.RecordsAffected & " " & " Envelope Barcode updated to tbl_ICCS
Master"
Set qdef = Nothing
Park:
If Err.Number > 0 Then
MsgBox Err.Number & " " & Err.Description
End If
Const cstrPrompt As String = _
"Are you sure you want to Delete this record? Yes/No"
If MsgBox(cstrPrompt, vbQuestionn + vbYesNo) = vbYes Then
Set qdef = CurrentDB.QueryDefs("14 Delete tblTempenvelopeBarcode")
qdef.Execute
MsgBox qdef.RecordsAffected & " " & " Records Deleted from tbl_Temp envbrcd"
Set qdef = Nothing
If Me.Dirty Then
Me.Dirty = False ' save the record
End If
End If
End Sub
Above code is working fine but I need the popup msg box (Yes or No) to also display the count of the records deleted in the 2nd msgbox instead of showing in the 3rd msg box.
I have tried all the possible ways but unable to do this, can anyone help me in this
Thanks