How to make checkbox not enabled after it is checked in continuous form

I have a contiunuous for with a checkbox (SaveCheck).  I use the following code (placed on the On Current and After update) to lock the record with the checkbox on it:
Me![Med].Locked = Me![SaveCheck]
Me![Sig].Locked = Me![SaveCheck]

Works great, but now I would like to have the checkbox not be enabled after the changes.   This way they will not be able to change the record again, but making the checkbox false.  Anything I try will either disable the checkbox for the whole form (not just the current record) or doesn't seem to work at all.

Any help greatly appreciated.

Carrie
madeatmidniteAsked:
Who is Participating?
 
arcrossCommented:
Hi Carrie, ive had a look to that, and you cannot set the conditional formatting for a a check box.
You can disable the other controls in the form. You could disable or enable the rest of the controls, using the condiotonal formatting, when the chckbox is true, then when is false, enable them again.
0
 
Jim HornMicrosoft SQL Server Developer, Architect, and AuthorCommented:
AFAIK you can't edit properties like .Enabled in a continuous form for only one record.

What you can do is to write code in the checkbox's .AfterUpdate event that checks certain criteria, and if it's met, do nothing.

Hope this helps.
-Jim
0
 
arcrossCommented:
Which version of access are using? If you are using Access 2000 or above, you can use Conditional formating to achive this. Its under FORMAT menu -> CONDITIONAL FORMATTING. Set the condtion you want to meet, and select the enable button.


0
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.

 
arcrossCommented:
You would choose, Condtion , 'Field Value Is', then select 'Equal', put TRUE and click enable button.
0
 
madeatmidniteAuthor Commented:
Thanks, it is Access 2002.   I'm going to give it a try -- be right back :)
carrie
0
 
madeatmidniteAuthor Commented:
It won't let me get to the conditional formatting with the checkbox.  It will let me if I try to go to one of the other text boxes, but it doesn't seem to like the checkbox being selected.  Any idea on what I am doing wrong ?

thanks
Carrie
0
 
madeatmidniteAuthor Commented:
I just didn't want to let them be able to check the box again and then be able to change the record (with the checkbox checked, it does a nice job of locking the current record).  Would your way do that?  

thanks for looking that up :)
carrie
0
 
madeatmidniteAuthor Commented:
Guess What ?

I added

Me![SaveCheck].Locked = Me![SaveCheck]

to my above code and it worked :)
I thought I had tried it once before and it didn't work well -- but now it seems to work fine !

Thanks for all your help.
0
 
arcrossCommented:
Glad it worked Carrie!
0
 
madeatmidniteAuthor Commented:
Sorry to bother, but it works great when it is in the form itself, but it doesn't like it when it becomes a subform.  Any suggestions?
thanks
carrie
0
 
arcrossCommented:
What happens??
0
 
madeatmidniteAuthor Commented:
Got it to work ok, except it doesn't like me to open a new record unless I am going in order.  If I go up a record or two to edit it and then try to enter a new record, it won't let me.  If I exit the program and then restart, it will work until I go out of order again :)  Have tried doing requery, but it looks like it is requerying the whole table that it is based on and I think that will start taking too much time as the database grows.  ALso tried Refresh, but didn't seem to get that to work either.  If you have any suggestion, that would be great.
thanks,
carrie
0
 
madeatmidniteAuthor Commented:
Actually, just played with it somemore, what it doesn't like is if the last SaveCheck is checked.  IF that is the case then, it won't let me open the new record.  Could it be because both the field and the checkmark are null and so with
Me![Med].Locked = Me![SaveCheck]  
they both are null so they are locked?  That's the only think I can think of.

Thanks,
carrie
0
 
Jim HornMicrosoft SQL Server Developer, Architect, and AuthorCommented:
Hi madeatmidnite

Since you've already accepted this question, you would get more expert responses if you create a new question, instead of posting follow-ups to this one.

Just my .02.
-Jim
0
 
madeatmidniteAuthor Commented:
0
 
Jim HornMicrosoft SQL Server Developer, Architect, and AuthorCommented:
TY
-Jim
0
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.

All Courses

From novice to tech pro — start learning today.