coding on Current

Hi Experts,
I'm having trouble to figure what I did wrong that one set of the coding is not working.  I need another pair of eyes to look at it.  Thanks
here are the code.  They both are check box (true/false ).  

 If Me.CPPETITIONER = True Then
     Me.CPNCTANF.Locked = True
     If stSecurity < 5 Then
        Me.CPPETITIONER.Locked = True
     Else
        Me.CPPETITIONER.Locked = False
     End If
  Else
     Me.CPNCTANF.Locked = False
  End If
 the above code is not working because after I checked the check box, exist out and I still can uncheck the check box (I'm currently stSecurity = 1)


  If Me.CPNCTANF = True Then
     Me.CPPETITIONER.Locked = True
     If stSecurity < 5 Then
        Me.CPNCTANF.Locked = True
     Else
        Me.CPNCTANF.Locked = False
     End If
  Else
     Me.CPPETITIONER.Locked = False
  End If

thanks
urjudoAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Dale FyeCommented:
You will probably have to call that code in both the Current event, and in the click event of CPPetitioner.
0
urjudoAuthor Commented:
you mean after update in CPPetitioner?
0
Dale FyeCommented:
if CPPetitioner is a checkbox, I prefer to use the Click Event,  something like:

Private sub CPPetitioner_Click

    Call Form_Current

End Sub
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

urjudoAuthor Commented:
I tired both code on both after update, it still not working.
0
urjudoAuthor Commented:
I just tried it again on the on click event, still not working.
0
Jeffrey CoachmanMIS LiasonCommented:
Please clearly define "Not Working"

You, may also have to define your IF logic to us in plain English, ...I cant follow it...?
after I checked the check box, exist out
"exist out"  ?

...or post a sample db and explain in detail what you are trying to accomplish...

What the bottom code there for?... is it relevant to the question about the first snippet?

Always strive to  keep this simple at first, and test each condition individually.
...then add your conditions one at a time.
This way you are only troubleshooting the last condition you added, ....not the entire code snippet...
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.