473,587 Members | 2,492 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Creating a checkbox to lock/unlock an entire form and subform

1 New Member
I have created a database that will be used among many users. In order to protect the data, I am trying to create a checkbox that can either lock or unlock the forn and subform for editing. It would also be useful if the background color of the fields changed color when locked. I have created the database in design mode and am not very familiar with VBA. Any insight would be greatly appreciated. Thanks!
Jun 26 '09 #1
1 3996
IT Couple
36 New Member
Hi
I'm not sure if the instructions will make sense but.
for the checks box use after_update event and change for instance this property me.Form.AllowEd its = False
Regarding changing the background you have to add a loop into the code
something like that
dim ctr as control
for each ctr in me.Form.Control s

if left(ctr.name,3 ) = "txt" then 'assuming all your text boxes start with txt
prefix
ctr.backcolor = vbred
end if


Next

'you can also check background for all text boxes regardless of name using
ctr.ControlType = acTextBox

Remember that in the after update event you need 2 kinds of code so you need
if checkbox = true then

else

end if

I hope it helps
Emil
Jul 1 '09 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
4525
by: John | last post by:
I've got multiple threads and processes that write to same file. Before writing all threads / processes first lock part of file and then write to file. If one thread / process locks file, another threads / processes can not lock this file again. And I want that all threads / processes wait until first thread frees lock by calling...
1
2324
by: BK | last post by:
Dear all, I need help with access 2000. I have a form "Child" with subform "Grand" (3 levels). I have a toggle box in every record in the lowest level of the form for status. I want to have a toggle box in the parent form (2nd level) that when I update it, all the toggle boxes in the subform are updated, but I still have the ability to...
7
9808
by: Saintor | last post by:
What I do now is I put a value in the tag property, and using the form_current event, I run through all controls properties until the ones with the required tag value are met. Sound OK in theory, but it is ... slow. I thought having a table with the name, type of controls and put my 'tag value' there. At the opening of the form, I would...
6
7615
by: F-13 | last post by:
I'm working on a BOM in Access 200 from an example downloaded from from the web. The sample database contains three tables, Assemblies (the list of items needed to assemble any assembly), Components (the list of items recognised by the Assemblies Table)and Output (a table used to display the BOM from a chosen assembly). It works fine but...
14
3816
by: Gary Nelson | last post by:
Anyone have any idea why this code does not work? FileOpen(1, "c:\JUNK\MYTEST.TXT", OpenMode.Binary, OpenAccess.ReadWrite, OpenShare.Shared) Dim X As Integer For X = 1 To 26 FilePut(1, Chr(X + 64)) Next Lock(1, 5, 10)
2
1954
by: Jack | last post by:
Hi, I have a asp page. This page pulls all data from a query. Part of the code is as follows: <% Response.Write "<table border='1' width='80%' height='1' cellspacing='1' >" Response.Write "<th>Key</th><th>SubgrantID</th><th>Title</th><th>Unlock</th><th>Unverify" %> <% do until sRS.eof
6
1573
by: DP | last post by:
hi, i need a little help. i have two tables and 2 forms, one with a subform. i have a 'fildID' in one of the subforms, and i have another table, which has the film information, including a checkbox, if the film is available. if i enter an id in the subform in filmid, how can i get the checkbox in another form to become unchecked?? (to...
45
4381
by: Chris Forone | last post by:
hello group, is there a chance for other functions to get the lock if i have following loop: while (running) { Lock local(mutex); }
8
4097
by: Clive Dixon | last post by:
Are there any issues I should be worried about when using C# 2.0 iterators in conjunction with lock, i.e. public IEnumerator GetEnumerator() { lock (lockObject) { foreach (object obj in collection) { yield return obj;
0
7920
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7849
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8215
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8347
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
8220
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6626
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
3844
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2358
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
1189
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.