Help with Msg box that executes (1 Viewer)

violentjay25

Registered User.
Local time
Yesterday, 21:18
Joined
Feb 22, 2005
Messages
30
I would like to remove the generic "You are about to append 1 rows" statement with something like. "Are you sure you want to add this record" then the user can click yes and it will add it or No and it will not. Here is my code. I need to know what and where to put it..I have never used error handling or message boxes

Private Sub cmdAdd_Click()
DoCmd.RunSQL "Insert into tbl_Projects (ProjectName, SystemsImpacted, SPRNum,ReleaseDate, Status, CSIPM, BPM, Implemented, StakeHolder, IBR1, IBR2, IBR3, Objective, SMERequirments, Phase) " & _
"Values ('" & Me.txtProjectName & "', '" & _
Me.TxtSystemsImpacted & "', '" & _
Me.txtSPR & "', '" & _
Me.txtReleaseDate & "', '" & _
Me.CboStatus & "', '" & _
Me.txtCSI & "', '" & _
Me.txtBPM & "', '" & _
Me.cboImplemented & "', '" & _
Me.cboStakeholder & "', '" & _
Me.cboIBR1 & "', '" & _
Me.cboIBR2 & "', '" & _
Me.cboIBR3 & "', '" & _
Me.txtObjective & "', '" & _
Me.txtSMERequirements & "', '" & _
Me.cboPhase & "')"
 

geoffcodd

Registered User.
Local time
Today, 03:18
Joined
Aug 25, 2002
Messages
87
Hi there,

Use

DoCmd.SetWarnings False 'Before

DoCmd.SetWarnings True 'After

Thanks
Geoff
 

KenHigg

Registered User
Local time
Yesterday, 22:18
Joined
Jun 9, 2004
Messages
13,327
Then you may want to put a msgbox before the first docmd...

Ken
 

Users who are viewing this thread

Top Bottom