Results 1 to 2 of 2

Thread: Confirm before update.

  1. #1
    Join Date
    Aug 2008
    Posts
    52

    Confirm before update.

    Hi to all you guys. Plz, kindly direct me on how best to go about doing the following: I have a table with the following column: employee no, transferedtolocation. I want a situation where before update, the computer should be able to check all the past transfer immediately on the table to see whether this person has been transfered to that location before now or not.

  2. #2
    Join Date
    May 2006
    Posts
    407
    This SQL will give you all the records that are currently in your table for this [employee no] that also have the transferedtolocation:
    Code:
    SELECT [employee no], [transferedtolocation]
    FROM IHaveATable
    WHERE [employee no] = 123 and [transferedtolocation] = 456;
    The "123" would be whatever the employee no is that you are currently working with, and "456" would be the transferred to location that you are interested in for this transaction.
    The form you are dealing with will have an event named BeforeUpdate that you can use to enter the VBA code to run the query with the SQL I have suggested. If the query returns any records you will know this employee has been transferred to this location before.

Posting Permissions

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