barnacleboy
New member
- Local time
- Today, 16:17
- Joined
- Jul 28, 2010
- Messages
- 2
Hi there!
I have some troubles using TempVars here. I want to log the current user when updating a record by using a data macro. The macro already works fine when logging the change date, but I can't get it working to log the user name. For logging the date I'm using the German "FestlegenFeld" function - I guess it's called "SetField" in the English version - and use "Now()" as parameter for the value. For logging the user name I wanted to use the same function and set the value parameter to the TempVar name which saves the logged-in user's ID: I assume the syntax for getting the previously saved user ID is "[TempVars]![tmpUserID]". When running the data macro on update, the error message "ID [TempVars]![tmpUserID] can't be found." is getting displayed, user logging isn't working, but the change date gets correctly saved.
Using the same TempVar access syntax for "tmpUserID" works fine when using it in a messagebox function of another macro - which is not a data macro. Are TempVars probably not available in data macros? (SetTempVar isn't available too btw.)
Thanks for answering my question!
Cheers
P
I have some troubles using TempVars here. I want to log the current user when updating a record by using a data macro. The macro already works fine when logging the change date, but I can't get it working to log the user name. For logging the date I'm using the German "FestlegenFeld" function - I guess it's called "SetField" in the English version - and use "Now()" as parameter for the value. For logging the user name I wanted to use the same function and set the value parameter to the TempVar name which saves the logged-in user's ID: I assume the syntax for getting the previously saved user ID is "[TempVars]![tmpUserID]". When running the data macro on update, the error message "ID [TempVars]![tmpUserID] can't be found." is getting displayed, user logging isn't working, but the change date gets correctly saved.
Using the same TempVar access syntax for "tmpUserID" works fine when using it in a messagebox function of another macro - which is not a data macro. Are TempVars probably not available in data macros? (SetTempVar isn't available too btw.)
Thanks for answering my question!
Cheers
P