473,498 Members | 1,930 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Setting textbox to accept data after a check box has been checked

112 New Member
I am Newbie using Access 2003. I am trying to have one list box and one textbox on my form grayed out (not useable) until a check box has been checked. Is there a simple way of doing this?
Oct 11 '07 #1
6 2512
Rabbit
12,516 Recognized Expert Moderator MVP
You'll have to use the VBA editor and the After Update event. Whether or not that's difficult for you I wouldn't know. Let us know if you understand any of that.
Oct 11 '07 #2
Redbeard
112 New Member
I know how to insert code into the VBA editor, however I do not posses the skills to write the code on my own (would love to learn, never the time). If someone has existing code that will do this and I can copy it into the right spot changing the names of the appropriate boxes and forms to match. If there is no code then I guess I am out of luck. I was hoping there was just a property setting that would do it, but things are never as easy as they appear.
Oct 12 '07 #3
missinglinq
3,532 Recognized Expert Specialist
I think this will do what you need. You have to set the Enabled Properties for YourTextBox and YourListBox to No in their property boxes, then use this code:

Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Current()
  2. If Not Me.NewRecord Then
  3.  If YourCheckBox Then
  4.    YourListBox.Enabled = True
  5.    YourTextBox.Enabled = True
  6.  Else
  7.    YourListBox.Enabled = False
  8.    YourTextBox.Enabled = False
  9.  End If
  10. Else
  11.  YourListBox.Enabled = False
  12.  YourTextBox.Enabled = False
  13. End If
  14. End Sub
  15.  
and

Expand|Select|Wrap|Line Numbers
  1. Private Sub YourCheckBox_Click()
  2. If YourCheckBox Then
  3.   YourListBox.Enabled = True
  4.   YourTextBox.Enabled = True
  5. Else
  6.   YourListBox.Enabled = False
  7.   YourTextBox.Enabled = False
  8. End If
  9. End Sub
  10.  
Welcome to TheScripts!

Linq ;0)>
Oct 12 '07 #4
Redbeard
112 New Member
Hi Missinglinq

Thanks for the code, but it is not working as intended yet. When I set my checkbox Enable property to NO all my records even ones that are already checked are disabled. Then when I check any record that is not checked, it enables the textbox and listbox in all my records. When I uncheck it, it disables the textbox and listbox in all my records. Is there something that the code needs to make it to target only the record it is currently on? Any help would be great!

Thanks
Oct 12 '07 #5
Redbeard
112 New Member
I final got it working... some of my code on Current was screwing it up.

Thanks!
Oct 15 '07 #6
missinglinq
3,532 Recognized Expert Specialist
Glad you got it working!

Linq ;0)>
Oct 16 '07 #7

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

Similar topics

2
1793
by: WhiskyRomeo | last post by:
I have a bound textbox (bindings are set at design time) to a dataset column. Sometimes the value of this textbox must be set so that the underlying database field gets updated to null when using...
2
2938
by: Bart Verbeke | last post by:
Hi, I have a form with 2 radio buttons (ACCEPT/REJECT). When the page is initially loaded, no textbox should be visible. When a user clicks the REJECT radio button, a textbox should...
4
2093
by: Ashwin Kutty | last post by:
Hi all, I sent this message to the jdbc list and received no response there and so am posting to this list hoping I could get some help here. Thanks in advance. ---------- Forwarded message...
18
18295
by: Dixie | last post by:
Can I set the Format property in a date/time field in code? Can I set the Input Mask in a date/time field in code? Can I set the Format of a Yes/No field to Checkbox in code? I am working on...
5
8696
by: Tosch | last post by:
I have a usercontrol with a label, a textbox, a treeview, a grid and a couple of checkboxes. The usercontrol is hosted on a form together with a cancel and a accept button. This form is used to...
5
4789
by: ameen.abdullah | last post by:
Hi Guys, I have a textbox in windows form that should only accept alphabets, numbers, spaces and underscore. If the textbox contains anyother character it should display a msg at the time of...
1
6435
by: laredotornado | last post by:
Hi, I'm using PHP 4.4.4 on Apache 2 on Fedora Core 5. PHP was installed using Apache's apxs and the php library was installed to /usr/local/php. However, when I set my "error_reporting"...
6
2727
by: Gari | last post by:
Hello everyone, I have two forms: FORM1 and FORM2. On FORM1 there is a check box (CHECK). When CHECK is checked, the data is updated in a YES/NO data type table (TABLE) field. On FORM2 I...
7
2875
by: robert.waters | last post by:
I have an Access database frontend linked via ODBC to a large (gigabytes) mysql database. I need to view a large amount of data in a a textbox (variable up to 300K), but I receive a 'there isnt...
0
7125
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,...
0
7165
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,...
0
7203
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...
1
6885
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7379
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...
0
5462
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,...
0
4588
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
1417
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 ...
0
290
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...

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.