[AccessD] Populate field with userid Environ A97 vs A2k+

O'Connor, Patricia (OTDA) Patricia.O'Connor at otda.state.ny.us
Tue Nov 20 13:23:31 CST 2007


Thank you - I had a feeling there might not be a work around 

The table was not being updated in, with or by a form when the error
occurred. 

Wanted to insure I knew the last person at the record.  It was something
that worked fine for 10 years - m$ could have made it read only if
modifying was a problem .  

**************************************************
* Patricia O'Connor
* Associate Computer Programmer Analyst
* OTDA - BDMA
* (W) mailto:Patricia.O'Connor at otda.state.ny.us
* (w) mailto:aa1160 at nysemail.state.ny.us
**************************************************
 

> 
--------------------------------------------------------
This e-mail, including any attachments, may be confidential, privileged or otherwise legally protected. It is intended only for the addressee. If you received this e-mail in error or from someone who was not authorized to send it to you, do not disseminate, copy or otherwise use this e-mail or its attachments.  Please notify the sender immediately by reply e-mail and delete the e-mail from your system. 


-----Original Message-----

> From: accessd-bounces at databaseadvisors.com 
> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of 
> Heenan, Lambert
> Sent: Tuesday, November 20, 2007 01:30 PM
> To: 'Access Developers discussion and problem solving'
> Subject: Re: [AccessD] Populate field with userid Environ A97 vs A2k+
> 
> Is there a workaround? No. You have to use an API call to get 
> the user ID.
> So quit defaulting these fields in your tables and add a tiny 
> bit of code to the BeforeInsert (for new records) and 
> BeforeUpdate (for edits) events on your forms.
> 
> There's only a very limited list of functions you can use in 
> the default value property of field in table design view. It 
> was even documented once, but I'm damned if I can locate it 
> in the Access XP help file. Oh well.
> 
> BTW it also makes sense to not allow Environ(). Environ is a 
> risky proposition because it is quite easy for a user to 
> change an environment variable, (like "USERNAME") and so 
> potentially bypass 'security'.
> 
> Lambert
> 
> -----Original Message-----
> From: accessd-bounces at databaseadvisors.com
> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of 
> O'Connor, Patricia (OTDA)
> Sent: Tuesday, November 20, 2007 12:34 PM
> To: Access Developers discussion and problem solving
> Subject: [AccessD] Populate field with userid Environ A97 vs A2k+
> 
> 
> I am upgrading an Access97 to Access2k to Access2k3.  I know 
> about having to create a function to use it in A2k and A2k3 (GRRR)  
> 
> I have been using =Environ("UserName") to populate a field 
> (LastUpdtBy) in a new record in my A97-tables for years.  
> 
> I created the function that was recommended and it works in 
> my vb/vba code portions. It is not working in the table field 
> default.  Gives me the runtime error # 3388 "unknown function 
> 'Environ'.
> 
> Is there a workaround?  If there is one in the archives, 
> please send a complete link. I have tried finding something 
> suggested in mails but can't find them easily.
> 
> I still think this ban was ridiculous or at least they should 
> have created a valid totally useable workaround
> 
> Thanks -  Have a wonderful Thanksgiving ALL Patti
> **************************************************
> * Patricia O'Connor
> * Associate Computer Programmer Analyst
> * OTDA - BDMA
> * (W) mailto:Patricia.O'Connor at otda.state.ny.us
> * (w) mailto:aa1160 at nysemail.state.ny.us
> **************************************************
> --------------------------------------------------------
> This e-mail, including any attachments, may be confidential, 
> privileged or otherwise legally protected. It is intended 
> only for the addressee. If you received this e-mail in error 
> or from someone who was not authorized to send it to you, do 
> not disseminate, copy or otherwise use this e-mail or its 
> attachments.  Please notify the sender immediately by reply 
> e-mail and delete the e-mail from your system.
> 
> 
> -- 
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
> -- 
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
> 
>





More information about the AccessD mailing list