[AccessD] Help on entering data -- when to do it?

Stuart McLachlan stuart at lexacorp.com.pg
Mon Dec 23 18:23:11 CST 2019


I use.a form of Jake's GetUserName API call to get the usernae.

There are a couple of ways to use it.

You can set it is the Before_Insert or Before_Update form event (depending on whether you 
want to know who originally created the record who last modifed the record.

Alternatively, you can have a text box  on your form bound to the ID and set it's default value 
to "=GetUserName()".  You can use any combination of Enabled/Locked/Visible for the 
textbox accordiing to your requireents.

Personally, I tend to use the latter ethod.



On 23 Dec 2019 at 22:04, Bob Walsh wrote:

> John,
> 
> If you get the userid when you start the application and store it in a
> Tempvars, it will be available for you to use everywhere in the
> application.
> 
> Bob
> 
> From: AccessD <accessd-bounces at databaseadvisors.com> On Behalf Of John
> W. Clark Sent: Monday, December 23, 2019 10:38 AM To: Access
> Developers discussion and problem solving
> <accessd at databaseadvisors.com> Subject: [AccessD] Help on entering
> data -- when to do it?
> 
> [Attn: This is an external email.]
> 
> Hey All! There are probably many people here who many not remember me.
> It has been a very long time since asking any questions here. This is
> because, (A) because of the list I became quite proficient, and (B) I
> haven't worked with Access in a very long time -- I've done some
> little stuff here and there, but no programming in a while. I now
> inherited one of my favorite tasks (I'm being very sarcastic here) and
> I am fixing the code of someone who is a non-programmer and wrote code
> that a department now wants to use.
> 
> Maybe it is because I have become rusty, but I now find myself needing
> some help. I've got it mostly working, but I have one little issue at
> the moment -- I added a field to find the user ID of the person logged
> in, and I want to be able to put that in the record, so we can track
> who made the entry. I initially did this for the onOpen event of the
> form, but now I am unable to turn off filtering and scroll through all
> the records. I can hit ESC and then do this, but I don't want the user
> to have to do this. So I'm thinking I need to assign that field
> elsewhere -- perhaps OnDirty? That is what I am asking -- at what
> point should I be putting this in? I never used the even OnDirty in
> all the years I programmed -- don't know why; just never needed to --
> so I'm a bit shaky on what it means exactly. Or perhaps there is a
> better way to do this?
> 
> 
> Notice: This electronic transmission is intended for the sole use of
> the individual or entity to which it is addressed and may contain
> confidential, privileged or otherwise legally protected information.
> If you are not the intended recipient, or if you believe you are not
> the intended recipient, you are hereby notified that any use,
> disclosure, copying, distribution, or the taking of any action in
> reliance on the contents of this information, is strictly prohibited.
> Niagara County is not responsible for the content of any external
> hyperlink referenced in this email or any email. IF YOU HAVE RECEIVED
> THIS TRANSMISSION IN ERROR, PLEASE NOTIFY THE SENDER IMMEDIATELY BY
> EMAIL AND DELETE THE ORIGINAL MESSAGE ALONG WITH ANY PAPER OR
> ELECTRONIC COPIES. Thank you for your cooperation. -- AccessD mailing
> list AccessD at databaseadvisors.com<mailto:AccessD at databaseadvisors.com>
> http://databaseadvisors.com/mailman/listinfo/accessd<http://databasead
> visors.com/mailman/listinfo/accessd> Website:
> http://www.databaseadvisors.com<http://www.databaseadvisors.com>
> 
> ________________________________
> This message and any attachments are intended for the use of the
> individual to whom it is addressed and may contain information that is
> privileged, business sensitive, confidential and/or exempt from
> disclosure under applicable laws and regulations. If you are not the
> intended recipient, be aware that any disclosure, copying,
> distribution, or use of the contents of this transmission is
> prohibited. If you have received this message in error, please inform
> the sender and delete all copies. Thank you. -- 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