I am out of my league but trying to learn from this forum about fOSUserName()
function. I have it working in my form by using the following method. Created a textbox in my form, in that textbox properties "Control Source" is: =fOSUserName()
. The textbox of course displays the current user. What I want to know is how to place this information into a table. Since the "Control Source" is already populated with: =fOSUserName()
I can't direct it to the field "UserID" with in the main table. I have tried setting =fOSUserName()
as the default value in the textbox properties and made the control source point to the table but then nothing works. I am using Access 2013. I don't care about security as it is not needed. I simply need a way to determine who is creating the record and record the value in a table. It would be nice to have the name display on the form. Ultimately, the record creator would be recalled an printed out similar to an invoice. Please assume I have very little knowledge when it comes to access.
1
votes
1 Answers
1
votes
Change the text box's Control Source to your UserID
field. And set the text box's Default Value to =fOSUserName()
Then when the form's current record is an existing row, the text box will display the stored UserID
value.
But when the form is on the "new record", the text box will be loaded with the fOSUserName
function's return value. If you save the new record, that value will be stored. But if you abort creation of the new record, that text box value will be discarded the same as any other value entered for that record.