I use Docmd Open query to open one append query in the script that has another code in it.
When I run the script, this option will opo out:
"You are about to run an append query that will modify data in your table"
"Yes/No"
If I answered "Yes", the script will run, but if I answer "No", the script will run as well.
If i press "No", i want the script to exit the sub. How can i grab the value of this "No"

Thanks

This seems strange when I click "no" it does not append. You can handle it manually if you wish which will overcome the problem.

If MsgBox("are you sure you want to append these records", vbYesNo) = vbYes Then
    DoCmd.SetWarnings False
    DoCmd.OpenQuery "Query4"
    DoCmd.SetWarnings True
End If
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.