View Single Post
Old 08-11-2011, 06:49 AM   #9
Apoco
Nerd with social skills
 
Apoco's Avatar
4
 
Join Date: May 2010
First Name: Alex
Location: Chattanooga, TN
Posts: 1,286
Trading: (37)
Apoco is a jewel in the roughApoco is a jewel in the roughApoco is a jewel in the rough
Default

Quote:
Originally Posted by elderboy02 View Post
That really is strange. Usually in VB/VBA you have to have your variable on the left. I manage a word template here at work with TONS of lines of code. We use it for a complex exam the physical therapists do. I too have to use hidden fields in order to get the darn thing to work right. VBA really is a b***h to work with.
Exactly! It kicks back an "Object Required" error if my variable is on the left...and it doesn't function when the variable is on the right.

I just had a thought. Maybe instead of having it check all of them at once I should have them checking every time the user updates a given field...that might work...I'll be back in a few. Time for more testing.

EDIT: OK. If I instead run a code that looks like this:

Quote:
Private Sub chkProduction_AfterUpdate()

If [chkProduction] = Yes Then
DLookup("[Production]", "tblUserPCE", "[UserID] = '" & Forms![frmNewUser]![strCurrentUser] & "'") = Yes
Else: [chkProduction] = ""
MsgBox "You may not create a user that can authorize Production issues"
End If

End Sub
And force it to check after each update it will work just fine on top of automatically changing the field to "No".

WHY DOES THIS WORK, BUT MY FIRST SOLUTION DOESN'T. *rage*
Posted via Mobile Device
Apoco is offline   Reply With Quote