troubleshooting Question

use UDF in table field's default value

Avatar of developingprogrammer
developingprogrammer asked on
Microsoft Access
5 Comments1 Solution484 ViewsLast Modified:
hey guys,

i've got a table and one of the fields is staffID.

i've got a UDF called WindowsUserName which gets the username from windows api. (NOT the lousy environ function - only noobs do that) hahahaha

i've got a table that matches staffID with windows username.

in my default value for this staffID field, i want the.... ta da! staffID!

so i'm thinking 2 ways i can do it

1) WindowsUserName_To_StaffID(WindowsUserName)
2) Dlookup( blah blaah blah where username = WindowsUserName)

i just can't seem to figure out how to use functions in default values.

i tried =WindowsUserName but it gave me ="WindowsUserName"

tried Eval("WindowsUserName") and =Eval("WindowsUserName") but to no avail = (

hrmm i'm not sure how to do it. could yall help me guys?

thanks so sooo much!! = ))
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 5 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros