Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2002
    Location
    Sacramento, CA
    Posts
    34

    Unanswered: Stopping 'Paste records' message

    I just took over this Access 97 DB and the following was already setup in it. It creates a mail list (Assignee Email List qry) then sends email assignee thier list of jobs. However, it stops every time it goes to add the new records to the temptbl.

    Does anyone knw how to stop it from asking "do you realy want to paste the records?"


    Set MyDB = CurrentDb
    Set MyRS = MyDB.OpenRecordset("Assignee Email List qry")
    MyRS.MoveFirst

    Do Until MyRS.EOF
    MsgTo = MyRS![Assign]

    ' set sql statement
    SQLstr = "SELECT [Job Assignments].ID, [Job Assignments].Contact, [Job Assignments].Site, [Job Assignments].Description"
    SQLstr = SQLstr & " INTO [temptbl] From [Job Assignments] WHERE ((([Job Assignments].Assign) = '" & MsgTo & "')"
    SQLstr = SQLstr & "And (([Job Assignments].Complete) = No)) ORDER BY [Job Assignments].ID;"

    ' creates temp tbl with data for single assignee
    DoCmd.RunSQL (SQLstr)

    ' Creates and sends the email
    DoCmd.SendObject acTable, "temptbl", "HTML(*.html)", MsgTo, "", "", EmailSubject, , false, "templete.html"

    'deletes the temp tbl
    DoCmd.DeleteObject acTable, "Temptbl"

    MyRS.MoveNext
    Loop

  2. #2
    Join Date
    Apr 2003
    Posts
    42

    This may solve it...

    The warning message comes up because of the use of DoCmd. In effect, the line of code :

    DoCmd.RunSQL (SQLstr)

    Is like clicking on the [!] button when you have an Access query open.



    You can try adding this code around the DoCmd...


    ....................

    DoCmd.SetWarnings False

    ' creates temp tbl with data for single assignee
    DoCmd.RunSQL (SQLstr)

    DoCmd.SetWarnings True

    .....................




    If that doesn't work, you'd have to code this differently and not use DoCmd.

  3. #3
    Join Date
    Nov 2002
    Location
    Sacramento, CA
    Posts
    34

    Re: This may solve it...

    Originally posted by ventelation
    The warning message comes up because of the use of DoCmd. In effect, the line of code :

    DoCmd.RunSQL (SQLstr)

    Is like clicking on the [!] button when you have an Access query open.



    You can try adding this code around the DoCmd...


    ....................

    DoCmd.SetWarnings False

    ' creates temp tbl with data for single assignee
    DoCmd.RunSQL (SQLstr)

    DoCmd.SetWarnings True

    .....................




    If that doesn't work, you'd have to code this differently and not use DoCmd.

    That was it......working great
    Last edited by dragracer; 07-01-03 at 18:11.
    Make the money, don't let the money make you.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •