473,396 Members | 1,707 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,396 software developers and data experts.

Using a combo box value to change a checkbox

I have a form (Form1) with a combo box (Combo43) with three values:

Reference 1
Antenatal 1
Quant 1

I also have two check boxes (check36 and check34)

What is the best way to implement such that when Reference 1 is
selected in the combo box, check34 changes from false to true, and
when Antenenal 1 or quant 1 is selected, check 36 changes to true?
I've tried something along the lines of:

Private Sub Combo43_AfterUpdate()
If Me.Combo43 = "Reference 1" Then
Me.Check32 = True
Else
Me.Check32 = False
End If
End Sub

I'm a beginner at this, so any help would be amazing. Thanks!

Aug 10 '07 #1
2 5412
What is the problem your running into? That's the way I would of done
it, but from the looks of your code you identified the object but not
the property your trying to alter try:

If Me!Combo43.Value = "Reference 1" Then
Me!Check32.Value = True
Else
Me!Check32.Value = False
End If

Aug 10 '07 #2
Your code as shown should work (it did for me).
So, what could be wrong?
Does the Source of your combo box have more than 1 column.
Look at the Properties of your Combo box. On the format tab, How many
columns are there?
If more than 1 column, in Column Widths does it look like this 0";1";1; ?
If so your Combo box is displaying Column 2 but is probably bound to the
first (hidden - 0 length) column.
I suspect this is the case as Access tries to hide the first column if it is
a primary key.

If so, your code should read like this (to confuse matters further, when it
comes to vba the first column of a combo box is 0, the second column is 1,
etc.)
Private Sub Combo43_AfterUpdate()
If Me.Combo43.column(1) = "Reference 1" Then
Me.Check32 = True
Else
Me.Check32 = False
End If
End Sub

Good Luck
Len Robichaud

<ke********@gmail.comwrote in message
news:11*********************@d30g2000prg.googlegro ups.com...
>I have a form (Form1) with a combo box (Combo43) with three values:

Reference 1
Antenatal 1
Quant 1

I also have two check boxes (check36 and check34)

What is the best way to implement such that when Reference 1 is
selected in the combo box, check34 changes from false to true, and
when Antenenal 1 or quant 1 is selected, check 36 changes to true?
I've tried something along the lines of:

Private Sub Combo43_AfterUpdate()
If Me.Combo43 = "Reference 1" Then
Me.Check32 = True
Else
Me.Check32 = False
End If
End Sub

I'm a beginner at this, so any help would be amazing. Thanks!

Aug 10 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Jason McDonald | last post by:
I have a PDF form that has a combo box "no_wireless_mics" with the values "1" "2" and " " where " " is the default. I need a JavaScript that will cause the check box "wireless_mics" to be checked...
4
by: Jack | last post by:
Hi, I have a checkbox the value which goes to a database via a asp page that builds the sql string. In the front end asp page, the checkbox code is written as follows: <i><input...
3
by: vgrssrtrs | last post by:
<html> <head> <script language="JavaScript"> <!-- /* *** Multiple dynamic combo boxes *** by Mirko Elviro, 9 Mar 2005 *** ***Please do not remove this comment
6
by: Robert | last post by:
Hello. I have been trying out the Lebans ToolTip Classes at http://www.lebans.com/tooltip.htm, to display "balloon" style help tips in a form. The classes I am using are located at...
3
by: Mark | last post by:
I have a form that contains the following: 2 radio buttons (Name and Number) 1 check box (for Inactive Members) 1 combo box (list of Member names or numbers) I use the radio buttons to...
6
by: Michael R. Pierotti | last post by:
Ok now I want to validate / auto select a value from a Combo box, 'cbInterfaceVersion Me.cbInterfaceVersion.Items.AddRange(New Object() {"v 3.3", "v 3.4"}) Me.cbInterfaceVersion.Location = New...
1
by: The Eclectic Electric | last post by:
I'd be very grateful if anyone could help me with this. From my limited knowledge of Javascript I don't think it is possible, but I'll punt anyway. I downloaded and very slightly adapted this...
4
by: copewithit | last post by:
Hi all, I'm trying to modify a record (in this case the name associated with the record) to a new name selected by the user in a combo box. Right now I have Single Form with a subform in datasheet...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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
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,...

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.