Update / Insert record confirmation prompts 
Author Message
 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  
 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  
 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  
 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  
 
 [ 4 post ] 

 Relevant Pages 

1. SendObject Method and Confirmation Prompt

2. Supress UpdateToProjectCentral confirmation prompt

3. Shell a DOS application and answer the confirmation prompts

4. update an inserted record

5. insert, update and delete record

6. Updating or inserting record

7. update an inserted record

8. Update SQL forces insert of record

9. Update an inserted record

10. insert/update records in table

11. Deleting record from dbgrid with confirmation

12. Deleting record from dbgrid with confirmation

 

 
Powered by phpBB® Forum Software