473,398 Members | 2,125 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Enable CheckBox with ComboBox

3
I need to enable a CheckBox(Jan) based on the selection of a ComboBox (Combo454) in Access 2010. The results I want is that when the answer of "Yes" is selected from the ComboBox then the CheckBox for the month of January will automatically be checked

I've tried several code combination, the following being the last of many the still have not worked:

Expand|Select|Wrap|Line Numbers
  1. Private Sub Combo454_AfterUpdate()
  2. If Combo454.Value = True Then
  3. Jan.Enabled = True
  4.  
  5. Else: Jan.Enabled = False
  6. End If
Sep 6 '12 #1

✓ answered by Seth Schrock

It depends on how you have in the row source for your combo box. If you just have the text "yes" and "no", then you would need the following code:
Expand|Select|Wrap|Line Numbers
  1. If Me.Combo454 = "Yes" Then
  2.     Me.Jan = True
  3. Else
  4.     Me.jan = False
  5. End If
If you have a table complete with a primary key, then you would test on the PK value.

Just curious, are you wanting to change the Enable property of the checkbox, or just whether it has a check mark? Your question leads me to believe the latter, but the code leads me to believe the former.

4 4871
Seth Schrock
2,965 Expert 2GB
It depends on how you have in the row source for your combo box. If you just have the text "yes" and "no", then you would need the following code:
Expand|Select|Wrap|Line Numbers
  1. If Me.Combo454 = "Yes" Then
  2.     Me.Jan = True
  3. Else
  4.     Me.jan = False
  5. End If
If you have a table complete with a primary key, then you would test on the PK value.

Just curious, are you wanting to change the Enable property of the checkbox, or just whether it has a check mark? Your question leads me to believe the latter, but the code leads me to believe the former.
Sep 6 '12 #2
tizzie
3
Thanks. Will give this a try. You are correct, I just want the box to reflect a check mark in it when the combobox answer is Yes.
Sep 7 '12 #3
tizzie
3
Thanks so much. Worked like a charm.
Sep 10 '12 #4
Seth Schrock
2,965 Expert 2GB
Great! Glad I could help.
Sep 10 '12 #5

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

Similar topics

1
by: David Wake | last post by:
I have two radio buttons and two checkboxes in a form. I'm trying to write some code so that when a radio button is selected, its corresponding checkbox is disabled. My code looks like this: ...
1
by: John Mullen | last post by:
I want to take the following HTLM and use javascript to turn on radio buttons if checkbox is checked, can I do this with javascript (maybe onClick or an array) or do i need a server side script ?...
7
by: Nicolae Fieraru | last post by:
Hi All, I am trying to change the rowsource of a combobox when I click on it. I played with many events, associated with the form and the combobox, but still haven't figured out what is the way...
6
by: Stu Carter | last post by:
Hi, I have an aspx page where some controls are initially disabled by the code-behind 'Page_Load' event. I want these controls to be dynamically enabled when the user checks a checkbox. ...
1
by: Ludwig | last post by:
Hello NG, how can I integrate a Combobox or a Checkbox in a Datagrid? Thanks, Ludwig
30
by: dbuchanan | last post by:
ComboBox databindng Problem == How the ComboBox is setup and used: My comboBox is populated by a lookup table. The ValueMember is the lookup table's Id and the DisplayMember is the text from a...
2
by: bigrich | last post by:
I'm a beginner to javascript and need help. I've searched the forum but can't piece the answer together. I need to be able to uncheck and disable a checkbox based on the option selected in a...
1
by: somdeep | last post by:
I am new in JavaScript. I have encountered a problem. I am stating the situaiton. The web page contains two combo boxes. If I select a combobox element through mouse then the other combobox gets...
9
by: Franky | last post by:
I have a usercontrol that inherits from ComboBox I'd like to add the feature that the user can delete any item Best would be that he could right click an element and a messagebox would ask if...
5
by: GoGs | last post by:
How can put checkBox in comboBox... Thanks -- GoGs
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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
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...
0
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
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...
0
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
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.