use the network Username as default in Access 2007

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I want to use the network Username as default value in a table. I have a
function defined that returns the value, but Access does not recognize my
function as valid.

The expression builder does not show my function in the list of functions,
even though the VB editor compiles and it is declared PUBLIC.
 
As far as I know, you cannot use your own VBA functions as defaults for
tables in any version of Access.

You'll have to set the value in code in the form.
 
I want to use the network Username as default value in a table. I have a
function defined that returns the value, but Access does not recognize my
function as valid.

The expression builder does not show my function in the list of functions,
even though the VB editor compiles and it is declared PUBLIC.


You can't set the default in a table to a function. you *can* however set
the default of the control on he form..and you get the same result.

If you NOT displaying this on the form, then use code, if it is for record
creating time, use the before-insert event.


me!CreatedByUser = fosuserName()

if you want to record the person who last modified the record, then move the
above code to the forms before update event....

so, you can still do this without wiring any code on the form if you use a
controls default setting, but that usually means the control is on he
form..and users can see, and possible edit the value (and, you might not
want that).

The "function" name used above is a guess...you have to use the actual
function name you have....
 
Back
Top