when i write my code for production user the form does not change im not sure why its doing this but here my code<>
Private Sub Form_Current() 'dim the control Dim ctl As Control 'if he user is in admin do not lock the fields. 'If IsUserInGroup(1) Then 'dont lock the form
For Each ctl In Me If ctl.ControlType = acTextBox Or ctl.ControlType = acComboBox Then ctl.Locked = True ctl.BackColor = RGB(200, 200, 200) 'grey End If Next 'End If
Yeah, she's got some lines REMmed out but everything matches up. It comes out to basically this when you cut it down:
For Each ctl In Me
If ctl.ControlType = acTextBox Or ctl.ControlType = acComboBox Then
ctl.Locked = True
ctl.BackColor = RGB(200, 200, 200) 'grey
End If
Next
If IsUserInGroup(4) Then
TSubmittedDate.Locked = False
TRequestor_Name.Locked = False
...
TSubmittedDate.BackColor = vbWhite
TRequestor_Name.BackColor = vbWhite
End If
As far as I can see everything SHOULD work. Again, this is one of those situations where I'd really need to see the database.
Give James the assist there because he made me re-look at the code. :)
James Gray
@Reply 6 years ago
I was referring to the If statement that checked if user was in Group(1). That looks like it is remmed out so that the lock code never runs since the user group check isn't performed. I didn't see the me.controls issue....
jannette jonesOP
@Reply 6 years ago
James and Richard i made the recommended changes and still not working correctly
If you are a Visitor, go ahead and post your reply as a
new comment, and we'll move it here for you
once it's approved. Be sure to use the same name and email address.