473,761 Members | 2,293 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Using a command button to toggle a checkbox

How can I use a transparent command button to change a checkbox?

I have my records set up in a continuous form and I want theuser to be able
to click on the record and have this toggle the "Print" checkbox. the
command button would be set up as transparent and cover the entire record.
Jul 5 '06 #1
2 11423
"John Smith" <so*****@micros oft.comwrote in
news:S0******** ***********@fe0 4.news.easynews .com:
How can I use a transparent command button to change a
checkbox?

I have my records set up in a continuous form and I want
theuser to be able to click on the record and have this toggle
the "Print" checkbox. the command button would be set up as
transparent and cover the entire record.
If you're at microsoft.com, you really should know this already.
You use the command buttons onClick event to set the
Forms!FormName! checkboxname.va lue = _
NOT Forms!FormName! checkboxname.va lue

You can replace Forms!FormName! with me. if the code module is in
the form.
--
Bob Quintal

PA is y I've altered my email address.

--
Posted via a free Usenet account from http://www.teranews.com

Jul 5 '06 #2

John Smith wrote:
How can I use a transparent command button to change a checkbox?

I have my records set up in a continuous form and I want theuser to be able
to click on the record and have this toggle the "Print" checkbox. the
command button would be set up as transparent and cover the entire record.
You can use code like this... I'm assuming you have a blnPrint
checkbox on each record (i.e. part of the subform's recordsource).

Note: this is code in the _sub_form.
Private Sub Form_Click()
'---toggles the "Print Me" checkbox. just click on the record
selector.
Me.blnOK = Not Me.blnOK
End Sub

Then you could filter the report you're printing this data in in the
Open event. just pass a filter like "[blnOK]=True" (blnOK is a yes/no
field in my report's recordsource.)

Option Compare Database

'------------------------------------------------------------
' mcrOpenFiltered Report
'
'------------------------------------------------------------
Function mcrOpenFiltered Report()
On Error GoTo mcrOpenFiltered Report_Err

DoCmd.OpenRepor t "rptYourReport" , acViewPreview, "",
"[blnOK]=True", acNormal
mcrOpenFiltered Report_Exit:
Exit Function

mcrOpenFiltered Report_Err:
MsgBox Error$
Resume mcrOpenFiltered Report_Exit

End Function

Jul 5 '06 #3

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

Similar topics

4
6683
by: Targa | last post by:
I have a form in which I want to have an button(image) displayed next to a checkbox when it is checked. If the box is unchecked, the button should disappear. How can I do this? Thanks!
3
26502
by: Noozer | last post by:
I have several tags on a webpage of the same class. If the user clicks a specific checkbox I'd like to be able to alter the display property of the class, affecting all objects of that class. This is an intranet application so we know that javascript will be enabled and the browser will be IE. How can I affect all the members of this class? Is there a way I can toggle the DISPLAY property of a class so all the elements using that class...
2
3494
by: Advo | last post by:
Basically, ive got information in a table for the layout purposes, as its text for a questionnaire What i Need, is for instance when the user click a radio button, that information can be hidden. I tried <div id="myarea" style="visibility:hidden"><STRONG><font color="#4475AA"Question 2:</font></STRONG></divetc
4
2358
by: Michael R | last post by:
I have what seems to me a strange problem. I have a continous form, toggle buttons of a field, a text control, and a command's button caption. When I write the following in the text control's source: =DCount("Id_Customer","Distribution","ToAdd=True") I get the correct result all the time, but when I write in code - Private Sub ToAdd_Click() Me.Command8.Caption = Str(DCount("Id_Customer", "Distribution", "ToAdd=True")) ...
3
5156
by: mountain.dog | last post by:
I have a query that shows a list of options that a user can toggle on or off using a checkbox. query... form... while($row = mysql_fetch_array($result))... <input name="menu_show_attribute" type="checkbox" class="checkbox"'); if ($row == 1) { echo (' value="'.$row.'" checked />
8
11747
by: Jeff Ciaccio | last post by:
I would like to create a toggle button, so I chose a radio and set its apperance to button. Is seems my method always makes this .checked = false. Can somebody help me to see the error in my ways? I'm guessing that I just need an event that triggers before it actually changes the value of the button. Private Sub radSound_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles radSound.Click If radSound.Checked = True...
4
6163
by: ameshkin | last post by:
I have a checkbox with an ID of svc_tp_1, and an image that corresponds with this checkbox below it. <input type="checkbox" name="checkbox" id="svc_tp_1" value="svc_tp_1" / <img src="images/screen_print.jpg" onclick="toggle('svc_tp_1'); return true;" /> I know how to get the checkbox to check when the image is clicked, but what I really want is a toggle. When a user clicks on the image, the system should first check to see if svc_tp_1...
1
2991
by: student4lifer | last post by:
Hello, I currently have a hyperlink to toggle the node, showing and hiding the list. Could someone show me how to use a checkbox instead of the hyperlink to do the same thing? Thanks. I tried the following line but the node's nextSibling becomes instead of <div>. Then I tried node. nextSibling.nextSibling but it didn't work. Please help!
3
2067
Dormilich
by: Dormilich | last post by:
Hi, I just have one thing about the label element, where I’m not certain. <label> is commonly used to attach visual/text information to a form control. so far, so good. <!-- just to make it visible --> <input type="checkbox" value="yes" id="mysql"> <label for="mysql">save MySQL</label> Now supposing I want to toggle the visibility of a <div> containing e.g. a description of something via JavaScript. although it is not exactly specified...
0
9377
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9989
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9925
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9811
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7358
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5266
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5405
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
3509
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2788
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.