Bobohhhhhh
New member
- Local time
- Today, 14:39
- Joined
- Feb 24, 2011
- Messages
- 2
I currently have two tables; Total & Out Proccessed Personnel
I have created a macro in design view which starts by setting a temporary varible via user input. It requests a SSN from the users and saves it under the name SSN.
The macro then executes three queries, using the tempVar as criteria for the WHERE expression.
The three queries are set up to append a record from one table to the other, update the record int he new table, then delete the old record from the original table.
My problem is that it seems the tempVar isnt recognized by any of the macros. When I run it it states you are making changes to 0 records. Below is my code for the three queries:
APPEND MACRO
INSERT INTO [Out Processed Personnel] ( SSAN, Category, Rank, [Last], [First] )
SELECT Total.SSAN, Total.Category, Total.Rank, Total.Last, Total.First
FROM Total
WHERE (((Total.SSAN)=TempVars![SSN]));
UPDATE MACRO
UPDATE [Out Processed Personnel] SET [Out Processed Personnel].[Archived Date] = Date()
WHERE ((([Out Processed Personnel].SSAN)=TempVars![SSN]));
DELETE MACRO
DELETE Total.SSAN, Total.Category, Total.Rank, Total.Last, Total.First
FROM Total
WHERE (((Total.SSAN)=TempVars![SSN]));
I have created a macro in design view which starts by setting a temporary varible via user input. It requests a SSN from the users and saves it under the name SSN.
The macro then executes three queries, using the tempVar as criteria for the WHERE expression.
The three queries are set up to append a record from one table to the other, update the record int he new table, then delete the old record from the original table.
My problem is that it seems the tempVar isnt recognized by any of the macros. When I run it it states you are making changes to 0 records. Below is my code for the three queries:
APPEND MACRO
INSERT INTO [Out Processed Personnel] ( SSAN, Category, Rank, [Last], [First] )
SELECT Total.SSAN, Total.Category, Total.Rank, Total.Last, Total.First
FROM Total
WHERE (((Total.SSAN)=TempVars![SSN]));
UPDATE MACRO
UPDATE [Out Processed Personnel] SET [Out Processed Personnel].[Archived Date] = Date()
WHERE ((([Out Processed Personnel].SSAN)=TempVars![SSN]));
DELETE MACRO
DELETE Total.SSAN, Total.Category, Total.Rank, Total.Last, Total.First
FROM Total
WHERE (((Total.SSAN)=TempVars![SSN]));