Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

need help with access form and active directory 1

Status
Not open for further replies.

pablohassan

Technical User
Nov 25, 2008
9
0
0
GB
Hello

A. I have a form in which one of the fields needs to have default value taken from currently logged user (AD user not access). I will have a table populated by various users, and one column of this table will contain user who added a record.

B. Now, I need to prevent users from deleting / changing records (should open a warning window) if their active directory name is different from the name populated in the record by the code from question A.

Thanks
 
See:
thread702-1485297

Not sure where you're at in your coding, but on the the BeforeUpdate of the form, you could put code that captures the AD and then compares. Such as:

Dim GetUser As String
GetUser = Environ("UserName")

If Getuser <> Me![textbox].value then
msgbox "Sorry, you're outta here!"
DoCmd.CancelEvent
Else
EndIF
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top