Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2002
    Posts
    154

    Question Unanswered: Suppress programming, confirmation messages

    I have a two part question that has to do with the same action. I have a form that is set to continuous forms--one line entered after another--to track the construction of a piece of furniture. Basically, the drivers who deliver and pick up the pieces fill out a BOL to say where it went to or came from. The lady who enters this info often copies and pastes lines from one tracking set to another to make data entry easier, since each BOL represents possibly several pieces from or going to the same place (ie, very similar tracking entries). I was wondering if anyone knew how to or if it is possible to: 1) suppress the "You are about the paste X lines" confirmation notice and 2) if it is possible to suspend afterupdate events in text boxes during a paste on that form only. I thank you in advance for your time and your responses.

  2. #2
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    Does the
    docmd.setwarnings False
    work? Remember to issue a
    docmd.setwarnings True
    when the code is done.

    I used to have a copy button (which copied all the fields to variables) and also a paste button on the form (which then pasted all the variables) For example (dimensioning these variables after the Option Compare Database)...

    dim varXX as variant
    dim intXX as integer

    then when they clicked the Copy button...

    Private sub cmd_copyRec_click()
    varXX = me!MyField1
    intXX = me!MyField2
    end sub

    and....

    Private sub cmd_PasteRec_click()
    docmd.setwarnings False (this is probably unneeded)
    me!MyField1 = varXX
    me!MyField2 = intXX
    docmd.setwarnings True (this is probably unneeded)
    end sub

    you could also goto a new record and paste the variables....

    Private sub cmd_PasteNewRec_click()
    docmd.setwarnings False (this is probably unneeded)
    DoCmd.GoToRecord , , acNewRec
    me!MyField1 = varXX
    me!MyField2 = intXX
    docmd.setwarnings True (this is probably unneeded)
    end sub

    Not sure if this is ideal but it worked pretty good. Also not sure about the suspend afterupdate events part of your question.
    Last edited by pkstormy; 05-10-07 at 19:27.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  3. #3
    Join Date
    Jan 2007
    Location
    California, USA
    Posts
    520
    Are you wanting to paste this common data one record at a time? Or if you have 5 pieces of furniture being worked on, do you want to paste 5 records at once?
    As far as the suspending the AfterUpdate event(s), you can put a global switch into each AfterUpdate event you are dealing with. As you get ready in your code to paste the record(s), set this switch to True, do the paste, then set the switch to False. Within each AfterUpdate event, you would test the switch. If True, bypass the code within the AfterUpdate event, because you will be within a Paste of record(s).
    HTH,

Posting Permissions

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