Robbyp2001
Registered User.
- Local time
- Today, 17:06
- Joined
- Oct 8, 2011
- Messages
- 143
Can anyone help me? I have created funtion that will run a series of queries in order to populate a number of records. I have created a message box which I hoped would give the option to cancel the process if needed. I produced a straighforward OK or Cancel message box, but even when clicking the 'cancel' option, the database goes ahead with the process anyway.
What am I doing wrong?
Anyway, here's the process if anyone can help,
Thanks for taking the time to read this
Oh, I'm using Access 2010
Rob
Private Sub Command21_Click()
retvalue = MsgBox("This Action Will Apply ALL Reports to the Selected Student. Continue?", vbOKCancel)
DoCmd.SetWarnings False
DoCmd.OpenQuery "Update Existing Student Records Step 1", acViewNormal, acEdit
DoCmd.OpenQuery "Update Existing Student Records Step 2", acViewNormal, acEdit
DoCmd.OpenQuery "Update Existing Student Records Step 2/5", acViewNormal, acEdit
DoCmd.OpenQuery "Update Existing Student Records Step 3", acViewNormal, acEdit
DoCmd.OpenQuery "Update Existing Student Records Step 4 Term 1 Report 1", acViewNormal, acEdit
DoCmd.OpenQuery "Update Existing Student Records Step 1", acViewNormal, acEdit
DoCmd.OpenQuery "Update Existing Student Records Step 2", acViewNormal, acEdit
DoCmd.OpenQuery "Update Existing Student Records Step 2/5", acViewNormal, acEdit
DoCmd.OpenQuery "Update Existing Student Records Step 3", acViewNormal, acEdit
DoCmd.OpenQuery "Update Existing Student Records Step 4 Term 1 Report 2", acViewNormal, acEdit
DoCmd.OpenQuery "Update Existing Student Records Step 1", acViewNormal, acEdit
DoCmd.OpenQuery "Update Existing Student Records Step 2", acViewNormal, acEdit
DoCmd.OpenQuery "Update Existing Student Records Step 2/5", acViewNormal, acEdit
DoCmd.OpenQuery "Update Existing Student Records Step 3", acViewNormal, acEdit
DoCmd.OpenQuery "Update Existing Student Records Step 4 Term 2 Report 1", acViewNormal, acEdit
DoCmd.OpenQuery "Update Existing Student Records Step 1", acViewNormal, acEdit
DoCmd.OpenQuery "Update Existing Student Records Step 2", acViewNormal, acEdit
DoCmd.OpenQuery "Update Existing Student Records Step 2/5", acViewNormal, acEdit
DoCmd.OpenQuery "Update Existing Student Records Step 3", acViewNormal, acEdit
DoCmd.OpenQuery "Update Existing Student Records Step 4 Term 2 Report 2", acViewNormal, acEdit
DoCmd.Close acForm, "Select Existing Student to Apply Reports", acSaveNo
DoCmd.SetWarnings False
retvalue = MsgBox("Completed!", vbExclamation)
End Sub
What am I doing wrong?
Anyway, here's the process if anyone can help,
Thanks for taking the time to read this
Oh, I'm using Access 2010
Rob
Private Sub Command21_Click()
retvalue = MsgBox("This Action Will Apply ALL Reports to the Selected Student. Continue?", vbOKCancel)
DoCmd.SetWarnings False
DoCmd.OpenQuery "Update Existing Student Records Step 1", acViewNormal, acEdit
DoCmd.OpenQuery "Update Existing Student Records Step 2", acViewNormal, acEdit
DoCmd.OpenQuery "Update Existing Student Records Step 2/5", acViewNormal, acEdit
DoCmd.OpenQuery "Update Existing Student Records Step 3", acViewNormal, acEdit
DoCmd.OpenQuery "Update Existing Student Records Step 4 Term 1 Report 1", acViewNormal, acEdit
DoCmd.OpenQuery "Update Existing Student Records Step 1", acViewNormal, acEdit
DoCmd.OpenQuery "Update Existing Student Records Step 2", acViewNormal, acEdit
DoCmd.OpenQuery "Update Existing Student Records Step 2/5", acViewNormal, acEdit
DoCmd.OpenQuery "Update Existing Student Records Step 3", acViewNormal, acEdit
DoCmd.OpenQuery "Update Existing Student Records Step 4 Term 1 Report 2", acViewNormal, acEdit
DoCmd.OpenQuery "Update Existing Student Records Step 1", acViewNormal, acEdit
DoCmd.OpenQuery "Update Existing Student Records Step 2", acViewNormal, acEdit
DoCmd.OpenQuery "Update Existing Student Records Step 2/5", acViewNormal, acEdit
DoCmd.OpenQuery "Update Existing Student Records Step 3", acViewNormal, acEdit
DoCmd.OpenQuery "Update Existing Student Records Step 4 Term 2 Report 1", acViewNormal, acEdit
DoCmd.OpenQuery "Update Existing Student Records Step 1", acViewNormal, acEdit
DoCmd.OpenQuery "Update Existing Student Records Step 2", acViewNormal, acEdit
DoCmd.OpenQuery "Update Existing Student Records Step 2/5", acViewNormal, acEdit
DoCmd.OpenQuery "Update Existing Student Records Step 3", acViewNormal, acEdit
DoCmd.OpenQuery "Update Existing Student Records Step 4 Term 2 Report 2", acViewNormal, acEdit
DoCmd.Close acForm, "Select Existing Student to Apply Reports", acSaveNo
DoCmd.SetWarnings False
retvalue = MsgBox("Completed!", vbExclamation)
End Sub