?
Solved

MS Access Form lock control

Posted on 2012-08-22
3
Medium Priority
?
759 Views
Last Modified: 2012-08-22
[I have a form (I inherited) with about a kajilion databound controls on it

There is a Check Box that I need to lock based on the value of a different datafield in my record source.

So

chkSuggestJunk needs to be locked when datafield  [Submit Stage] = 'Reject Submit'

This is the image of the checkbox properties

Screenprint
0
Comment
Question by:lrbrister
3 Comments
 
LVL 1

Accepted Solution

by:
jjnet123 earned 2000 total points
ID: 38321067
In the "OnCurrent" property of the form, add the following VBA code:

If Me.[Submit Stage] = "Reject Submit" Then Me.chkSuggestJunk.Enabled = False
0
 
LVL 66

Expert Comment

by:Jim Horn
ID: 38321081
The code for this is simple...

If Me![Sumbit Range] = "Reject Submit" then
   Me.chkSuggestJunk.Locked = True
Else
   Me.chkSuggestJunk.Locked = False
End If

The trick is .. how many places will you need to execute it?  Examples are ... Form.Open, Form.BeforeInsert, [Submit Change].AfterUpdate, etc.
0
 

Author Closing Comment

by:lrbrister
ID: 38321187
Excellent

Watch for followup
0

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

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

We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
Lost Word File? Eagerly, need it back? Read ahead; this File Recovery guide is for you.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

840 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