Hi, I will like to prevent some users modifying the data of a drop down box on a form. I already have the users and groups security setup. I dont want to hide the field. Is there a vba code for this. Appreciate any help.
Hi, I will like to prevent some users modifying the data of a drop down box on a form. I already have the users and groups security setup. I dont want to hide the field. Is there a vba code for this. Appreciate any help.

This month, every Windows Secrets subscriber can download a one-chapter excerpt of Windows 7: The Missing Manual.Windows 7: The Missing Manual provides valuable information to help you overcome these difficulties in learning a new operating system. Subscribe today to download your free excerpt.
You can put code in the On Open or On Load event of the form to set the Locked property of the combo box to True or False depending on the user. You can use CurrentUser to find out the Access login name, if you need to know if CurrentUser is member of a specific group, see Microsoft Access Security FAQ available in the Download Center (there is an online version of this document, but the page times out at the moment).
Thank you so much hans, I read the document but it seems that it does not talk about restricting a determine field in a form. I found some stuff about restricting some people from table and queries.
There is no built-in support for limiting access to specific fields in a table or query. As I indicated in my previous reply, you can do this at the form level by placing code in the On Open or On Load event. Here is a crude example:
Private Sub Form_Load()
Select Case CurrentUser
Case "Designer", "Manager", "Anne C"
Me.SomeControl.Locked = False
Case Else
Me.SomeControl.Locked = True
End Select
End Sub
If you want to limit access based on group membership, you can use the functions from the section "How can I obtain group and user membership information programmatically?", for example the faq_IsUserInGroup function:
Private Sub Form_Load()
Me.SomeControl.Locked = (faq_IsUserInGroup("PowerUsers", CurrentUser) = False)
End Sub
Thank you so much Hans. You are always a live saver.