Results 1 to 5 of 5
  1. #1
    tcheck is offline Competent Performer
    Windows 7 Access 2007
    Join Date
    Nov 2010
    Posts
    131

    BeforeUpdate in a form

    We have a form that I need to track the producerID before it changes so we can tell the who the former producer was. I thought the BeforeUpdate would work but it gives me the producerID of the producer we are changing it to. Here is the code I am using in the field.

    Private Sub Combo17_BeforeUpdate(Cancel As Integer)
    [FormerProducerID] = Me![ProducerID]
    End Sub

    How can I get the produceID before it's changed?

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716
    Please provide a little context for this post. The 30,000 ft overview of the application/database/business.
    What does FormerProducerID contain before you assign it the value in Me![ProducerID]??

    Tell us more about the process supported by filling in the Form and where FormerProducerID fits in the grand scheme of things.

  3. #3
    tcheck is offline Competent Performer
    Windows 7 Access 2007
    Join Date
    Nov 2010
    Posts
    131
    The links had little to do with my question?

  4. #4
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716
    The links had little to do with my question?
    What links????

    You didn't answer my question---

    What does FormerProducerID contain before you assign it the value in Me![ProducerID]??

  5. #5
    Bulzie is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    Nov 2015
    Posts
    1,463
    Various ways, try create an unbound invisible field on form called vProducerID

    Using OnCurrent Event of Form
    me.vProducerID = me.ProducerID

    Only write it when ProducerID value changes so On AfterUpdate on me.ProducerID
    me.FormerProducerId = me.vProducerID

Please reply to this thread with any new information or opinions.

Similar Threads

  1. BeforeUpdate: Could not update; currently locked.
    By v7davisa in forum Programming
    Replies: 3
    Last Post: 09-26-2014, 04:18 PM
  2. Using the Form.BeforeUpdate property
    By Access_Novice in forum Programming
    Replies: 6
    Last Post: 01-01-2014, 08:45 PM
  3. Beforeupdate to early
    By R_Badger in forum Forms
    Replies: 3
    Last Post: 02-09-2012, 10:38 AM
  4. exit form using BeforeUpdate 'or' cmdButton
    By ConfusedMike in forum Forms
    Replies: 9
    Last Post: 09-21-2011, 10:05 PM
  5. BeforeUpdate in a Form in Datasheet view
    By fitshase in forum Forms
    Replies: 7
    Last Post: 07-29-2011, 08:53 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums