?
Solved

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

Posted on 2005-05-16
16
Medium Priority
?
267 Views
Last Modified: 2012-05-05
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
0
Comment
Question by:madeatmidnite
  • 8
  • 5
  • 3
16 Comments
 
LVL 66

Expert Comment

by:Jim Horn
ID: 14010996
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
 
LVL 8

Expert Comment

by:arcross
ID: 14011030
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
 
LVL 8

Expert Comment

by:arcross
ID: 14011053
You would choose, Condtion , 'Field Value Is', then select 'Equal', put TRUE and click enable button.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

by:madeatmidnite
ID: 14011096
Thanks, it is Access 2002.   I'm going to give it a try -- be right back :)
carrie
0
 

Author Comment

by:madeatmidnite
ID: 14011125
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
 
LVL 8

Accepted Solution

by:
arcross earned 2000 total points
ID: 14011134
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
 

Author Comment

by:madeatmidnite
ID: 14011179
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
 

Author Comment

by:madeatmidnite
ID: 14011214
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
 
LVL 8

Expert Comment

by:arcross
ID: 14011235
Glad it worked Carrie!
0
 

Author Comment

by:madeatmidnite
ID: 14011819
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
 
LVL 8

Expert Comment

by:arcross
ID: 14016751
What happens??
0
 

Author Comment

by:madeatmidnite
ID: 14017516
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
 

Author Comment

by:madeatmidnite
ID: 14017692
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
 
LVL 66

Expert Comment

by:Jim Horn
ID: 14018971
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
 
LVL 66

Expert Comment

by:Jim Horn
ID: 14020052
TY
-Jim
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Code that checks the QuickBooks schema table for non-updateable fields and then disables those controls on a form so users don't try to update them.
Microsoft Access has a limit of 255 columns in a single table; SQL Server allows tables with over 255 columns, but reading that data is not necessarily simple.  The final solution for this task involved creating a custom text parser and then reading…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

616 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question