Update / Insert record confirmation prompts
Author |
Message |
Dave Jone #1 / 4
|
 Update / Insert record confirmation prompts
I am running this code... sSQL = "INSERT INTO tblJobs ( req_ref, user_ref, job_location, job_ext, job_priority, job_description, job_status )" & _ " SELECT tblRequests.req_ref, tblRequests.user_ref, tblRequests.req_location, tblRequests.req_ext, tblRequests.job_priority, tblRequests.req_description, '1' AS Expr1" & _ " FROM tblRequests" & _ " WHERE (((tblRequests.req_ref) = " & Me!req_ref & "))" DoCmd.RunSQL (sSQL) sSQL = "UPDATE tblRequests SET tblRequests.act_ref = 1 WHERE (((tblRequests.req_ref)=" & Me!req_ref & "))" DoCmd.RunSQL sSQL It works fine, but comes up with annoying Access prompts that say things like... You are about to append 1 row(s) Blah, blah, blah... YES | NO You are about to update 1 row(s) Blah, blah, blah... YES | NO How do I stop these annoying confirmations from being displayed to the user? Thanks, Dave Jones
|
Sat, 09 Aug 2003 20:12:28 GMT |
|
 |
MacDermot #2 / 4
|
 Update / Insert record confirmation prompts
Docmd.setwarnings false. Remember to turn your warnings back on afterwards, or you might miss something you'd like to know. In fact, I prefer to use CurrentDb.Execute sSQL,dbFailOnError over DoCmd.RunSQL, because this does return warnings when the process fails, but not the confirm prompts. HTH - Turtle
Quote: > I am running this code... > sSQL = "INSERT INTO tblJobs ( req_ref, user_ref, job_location, > job_ext, job_priority, job_description, job_status )" & _ > " SELECT tblRequests.req_ref, tblRequests.user_ref, > tblRequests.req_location, tblRequests.req_ext, tblRequests.job_priority, > tblRequests.req_description, '1' AS Expr1" & _ > " FROM tblRequests" & _ > " WHERE (((tblRequests.req_ref) = " & Me!req_ref & "))" > DoCmd.RunSQL (sSQL) > sSQL = "UPDATE tblRequests SET tblRequests.act_ref = 1 WHERE > (((tblRequests.req_ref)=" & Me!req_ref & "))" > DoCmd.RunSQL sSQL > It works fine, but comes up with annoying Access prompts that say things > like... > You are about to append 1 row(s) > Blah, blah, blah... > YES | NO > You are about to update 1 row(s) > Blah, blah, blah... > YES | NO > How do I stop these annoying confirmations from being displayed to the user? > Thanks, > Dave Jones
|
Sat, 09 Aug 2003 20:26:00 GMT |
|
 |
Dave Jone #3 / 4
|
 Update / Insert record confirmation prompts
Ah yes. Forgot about 'CurrentDb.Execute'! Spent too much time over the last year laying on beaches and not enough time programming! Thanks Turtle(?) Dave
Quote: > Docmd.setwarnings false. > Remember to turn your warnings back on afterwards, or you might miss > something you'd like to know. > In fact, I prefer to use > CurrentDb.Execute sSQL,dbFailOnError > over DoCmd.RunSQL, because this does return warnings when the process fails, > but not the confirm prompts. > HTH > - Turtle
> > I am running this code... > > sSQL = "INSERT INTO tblJobs ( req_ref, user_ref, job_location, > > job_ext, job_priority, job_description, job_status )" & _ > > " SELECT tblRequests.req_ref, tblRequests.user_ref, > > tblRequests.req_location, tblRequests.req_ext, tblRequests.job_priority, > > tblRequests.req_description, '1' AS Expr1" & _ > > " FROM tblRequests" & _ > > " WHERE (((tblRequests.req_ref) = " & Me!req_ref & "))" > > DoCmd.RunSQL (sSQL) > > sSQL = "UPDATE tblRequests SET tblRequests.act_ref = 1 WHERE > > (((tblRequests.req_ref)=" & Me!req_ref & "))" > > DoCmd.RunSQL sSQL > > It works fine, but comes up with annoying Access prompts that say things > > like... > > You are about to append 1 row(s) > > Blah, blah, blah... > > YES | NO > > You are about to update 1 row(s) > > Blah, blah, blah... > > YES | NO > > How do I stop these annoying confirmations from being displayed to the > user? > > Thanks, > > Dave Jones
|
Sat, 09 Aug 2003 20:51:31 GMT |
|
 |
Tony Oakle #4 / 4
|
 Update / Insert record confirmation prompts
Use DoCmd.SetWarnings False to turn them off then DoCmd.SetWarnings True to turn them back on again Hope this helps Tony Oakley Quote:
> I am running this code... > sSQL = "INSERT INTO tblJobs ( req_ref, user_ref, job_location, > job_ext, job_priority, job_description, job_status )" & _ > " SELECT tblRequests.req_ref, tblRequests.user_ref, > tblRequests.req_location, tblRequests.req_ext, tblRequests.job_priority, > tblRequests.req_description, '1' AS Expr1" & _ > " FROM tblRequests" & _ > " WHERE (((tblRequests.req_ref) = " & Me!req_ref & "))" > DoCmd.RunSQL (sSQL) > sSQL = "UPDATE tblRequests SET tblRequests.act_ref = 1 WHERE > (((tblRequests.req_ref)=" & Me!req_ref & "))" > DoCmd.RunSQL sSQL > It works fine, but comes up with annoying Access prompts that say things > like... > You are about to append 1 row(s) > Blah, blah, blah... > YES | NO > You are about to update 1 row(s) > Blah, blah, blah... > YES | NO > How do I stop these annoying confirmations from being displayed to the user? > Thanks, > Dave Jones
|
Sat, 09 Aug 2003 21:08:52 GMT |
|
|
|