In my database, I have a table named "DataTable" with the following four fields: [Database_ID], [Flex_ID], [Last_Updated], [Owner].
[Database_ID] is used to link tables/queries/forms and is static. [Flex_ID] is used by the company, and is the ID that appears on all forms.
[Last_Updated] is a date/time field that allows me to pull the most recent record for each[Database_ID] value. For tracking purposes, I am not updating existing rows, but rather, adding new rows with modified data.
Occasionally, the [Flex_ID]s for two [Database_ID]s will swap (ie. After a swap between ([Database_ID] = 1 and [Flex_ID] = Alpha) and ([Database_ID] = 2 and [Flex_ID] = Bravo), the new values are ([Database_ID] = 1 and [Flex_ID] = Bravo) and ([Database_ID] = 2 and [Flex_ID] = Alpha).
In order to facilitate this swap, I would like to create a form with three controls: An input box for each[Flex_ID] to be swapped, and a button to run the swap.
For the above example, believe that the On_Click command for the button needs to do the following:
1. Copy the most recent record for each of the [Database_ID]s corresponding to the [Flex_ID]s with [Upload_Date] changed to =Date()
2. For [Database_ID] = 1, change [Flex_ID] in the most recent record to DummyID
3. For [Database_ID] = 2, change [Flex_ID] in the most recent record to Alpha
4. For [Database_ID] = 1, change [Flex_ID] in the most recent record to Bravo
[Database_ID] is used to link tables/queries/forms and is static. [Flex_ID] is used by the company, and is the ID that appears on all forms.
[Last_Updated] is a date/time field that allows me to pull the most recent record for each[Database_ID] value. For tracking purposes, I am not updating existing rows, but rather, adding new rows with modified data.
Occasionally, the [Flex_ID]s for two [Database_ID]s will swap (ie. After a swap between ([Database_ID] = 1 and [Flex_ID] = Alpha) and ([Database_ID] = 2 and [Flex_ID] = Bravo), the new values are ([Database_ID] = 1 and [Flex_ID] = Bravo) and ([Database_ID] = 2 and [Flex_ID] = Alpha).
In order to facilitate this swap, I would like to create a form with three controls: An input box for each[Flex_ID] to be swapped, and a button to run the swap.
For the above example, believe that the On_Click command for the button needs to do the following:
1. Copy the most recent record for each of the [Database_ID]s corresponding to the [Flex_ID]s with [Upload_Date] changed to =Date()
2. For [Database_ID] = 1, change [Flex_ID] in the most recent record to DummyID
3. For [Database_ID] = 2, change [Flex_ID] in the most recent record to Alpha
4. For [Database_ID] = 1, change [Flex_ID] in the most recent record to Bravo