473,662 Members | 2,760 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Unchecking check boxes and text boxes in a form

2 New Member
From a newbie.

MSAccess 2000. I have a form with checkboxes and text boxes bound to their respective fields in a table. Using a query, I am able to create a report based on those checked boxes. What I want to do is create a command button to clear those check boxes and text boxes after printing.

I saw a similar post, but it didn't work for me. I'm sure there is a simple solution, but I can't figure it out.
Apr 3 '07 #1
3 4137
ChaseCox
294 Contributor
This is how I do it. Make an additional check box that has the following code behind it.

Expand|Select|Wrap|Line Numbers
  1. Private Sub chkpc_AfterUpdate()
  2.  
  3. ' Call MakeFilter
  4.  
  5.  If chkpc = True Then
  6.  
  7.         Me.chkp3.DefaultValue = True
  8.         Me.chkp4.DefaultValue = True
  9.         Me.chkp5.DefaultValue = True
  10.         Me.chkp6.DefaultValue = True
  11.         Me.chkp7s.DefaultValue = True
  12.         Me.chkp7d.DefaultValue = True
  13.         Me.chkp8.DefaultValue = True
  14.         Me.chkp10.DefaultValue = True
  15.         Me.chkpu1.DefaultValue = True
  16.         Me.chkpu2.DefaultValue = True
  17.         Me.chkpu3.DefaultValue = True
  18.         Me.chkpc1.DefaultValue = True
  19.         Me.chkpc2.DefaultValue = True
  20.         Me.chkph1.DefaultValue = True
  21.         Me.chkph2.DefaultValue = True
  22.         Me.chkph3.DefaultValue = True
  23.         Me.chkph4.DefaultValue = True
  24.         Me.chkph5.DefaultValue = True
  25.         Me.chkph6.DefaultValue = True
  26.         Me.chkph7.DefaultValue = True
  27.         Me.chkph8.DefaultValue = True
  28.         Me.chkph9.DefaultValue = True
  29.         Me.chkph10.DefaultValue = True
  30.         Me.chkph11.DefaultValue = True
  31.         Me.chkph12.DefaultValue = True
  32.         Me.chkph13.DefaultValue = True
  33.         Me.chkph14.DefaultValue = True
  34.         Me.chkph15.DefaultValue = True
  35.         Me.chkph16.DefaultValue = True
  36.         Me.chkph17.DefaultValue = True
  37.         Me.chkph18.DefaultValue = True
  38.         Me.chkpv1.DefaultValue = True
  39.         Me.chkpv2.DefaultValue = True
  40.         Me.chkpv3.DefaultValue = True
  41.         Me.chkpv4.DefaultValue = True
  42.         Me.chkpv5.DefaultValue = True
  43.         Me.chkpv6.DefaultValue = True
  44.  
  45.  
  46.  Else
  47.  
  48.  
  49.         Me.chkp3.DefaultValue = False
  50.         Me.chkp4.DefaultValue = False
  51.         Me.chkp5.DefaultValue = False
  52.         Me.chkp6.DefaultValue = False
  53.         Me.chkp7s.DefaultValue = False
  54.         Me.chkp7d.DefaultValue = False
  55.         Me.chkp8.DefaultValue = False
  56.         Me.chkp10.DefaultValue = False
  57.         Me.chkpu1.DefaultValue = False
  58.         Me.chkpu2.DefaultValue = False
  59.         Me.chkpu3.DefaultValue = False
  60.         Me.chkpc1.DefaultValue = False
  61.         Me.chkpc2.DefaultValue = False
  62.         Me.chkph1.DefaultValue = False
  63.         Me.chkph2.DefaultValue = False
  64.         Me.chkph3.DefaultValue = False
  65.         Me.chkph4.DefaultValue = False
  66.         Me.chkph5.DefaultValue = False
  67.         Me.chkph6.DefaultValue = False
  68.         Me.chkph7.DefaultValue = False
  69.         Me.chkph8.DefaultValue = False
  70.         Me.chkph9.DefaultValue = False
  71.         Me.chkph10.DefaultValue = False
  72.         Me.chkph11.DefaultValue = False
  73.         Me.chkph12.DefaultValue = False
  74.         Me.chkph13.DefaultValue = False
  75.         Me.chkph14.DefaultValue = False
  76.         Me.chkph15.DefaultValue = False
  77.         Me.chkph16.DefaultValue = False
  78.         Me.chkph17.DefaultValue = False
  79.         Me.chkph18.DefaultValue = False
  80.         Me.chkpv1.DefaultValue = False
  81.         Me.chkpv2.DefaultValue = False
  82.         Me.chkpv3.DefaultValue = False
  83.         Me.chkpv4.DefaultValue = False
  84.         Me.chkpv5.DefaultValue = False
  85.         Me.chkpv6.DefaultValue = False
  86.  
  87.  End If
  88.  
  89. End Sub
  90.  
Where the chk.... represent the names of different check boxes. This should work. Also makesure that the default value of your check box is set to NO, and not left blank. This can be set by selecting the appropriate check box and looking at its properties.
Apr 3 '07 #2
winky10
2 New Member
This is how I do it. Make an additional check box that has the following code behind it.

Expand|Select|Wrap|Line Numbers
  1. Private Sub chkpc_AfterUpdate()
  2.  
  3. ' Call MakeFilter
  4.  
  5.  If chkpc = True Then
  6.  
  7.         Me.chkp3.DefaultValue = True
  8.         Me.chkp4.DefaultValue = True
  9.         Me.chkp5.DefaultValue = True
  10.         Me.chkp6.DefaultValue = True
  11.         Me.chkp7s.DefaultValue = True
  12.         Me.chkp7d.DefaultValue = True
  13.         Me.chkp8.DefaultValue = True
  14.         Me.chkp10.DefaultValue = True
  15.         Me.chkpu1.DefaultValue = True
  16.         Me.chkpu2.DefaultValue = True
  17.         Me.chkpu3.DefaultValue = True
  18.         Me.chkpc1.DefaultValue = True
  19.         Me.chkpc2.DefaultValue = True
  20.         Me.chkph1.DefaultValue = True
  21.         Me.chkph2.DefaultValue = True
  22.         Me.chkph3.DefaultValue = True
  23.         Me.chkph4.DefaultValue = True
  24.         Me.chkph5.DefaultValue = True
  25.         Me.chkph6.DefaultValue = True
  26.         Me.chkph7.DefaultValue = True
  27.         Me.chkph8.DefaultValue = True
  28.         Me.chkph9.DefaultValue = True
  29.         Me.chkph10.DefaultValue = True
  30.         Me.chkph11.DefaultValue = True
  31.         Me.chkph12.DefaultValue = True
  32.         Me.chkph13.DefaultValue = True
  33.         Me.chkph14.DefaultValue = True
  34.         Me.chkph15.DefaultValue = True
  35.         Me.chkph16.DefaultValue = True
  36.         Me.chkph17.DefaultValue = True
  37.         Me.chkph18.DefaultValue = True
  38.         Me.chkpv1.DefaultValue = True
  39.         Me.chkpv2.DefaultValue = True
  40.         Me.chkpv3.DefaultValue = True
  41.         Me.chkpv4.DefaultValue = True
  42.         Me.chkpv5.DefaultValue = True
  43.         Me.chkpv6.DefaultValue = True
  44.  
  45.  
  46.  Else
  47.  
  48.  
  49.         Me.chkp3.DefaultValue = False
  50.         Me.chkp4.DefaultValue = False
  51.         Me.chkp5.DefaultValue = False
  52.         Me.chkp6.DefaultValue = False
  53.         Me.chkp7s.DefaultValue = False
  54.         Me.chkp7d.DefaultValue = False
  55.         Me.chkp8.DefaultValue = False
  56.         Me.chkp10.DefaultValue = False
  57.         Me.chkpu1.DefaultValue = False
  58.         Me.chkpu2.DefaultValue = False
  59.         Me.chkpu3.DefaultValue = False
  60.         Me.chkpc1.DefaultValue = False
  61.         Me.chkpc2.DefaultValue = False
  62.         Me.chkph1.DefaultValue = False
  63.         Me.chkph2.DefaultValue = False
  64.         Me.chkph3.DefaultValue = False
  65.         Me.chkph4.DefaultValue = False
  66.         Me.chkph5.DefaultValue = False
  67.         Me.chkph6.DefaultValue = False
  68.         Me.chkph7.DefaultValue = False
  69.         Me.chkph8.DefaultValue = False
  70.         Me.chkph9.DefaultValue = False
  71.         Me.chkph10.DefaultValue = False
  72.         Me.chkph11.DefaultValue = False
  73.         Me.chkph12.DefaultValue = False
  74.         Me.chkph13.DefaultValue = False
  75.         Me.chkph14.DefaultValue = False
  76.         Me.chkph15.DefaultValue = False
  77.         Me.chkph16.DefaultValue = False
  78.         Me.chkph17.DefaultValue = False
  79.         Me.chkph18.DefaultValue = False
  80.         Me.chkpv1.DefaultValue = False
  81.         Me.chkpv2.DefaultValue = False
  82.         Me.chkpv3.DefaultValue = False
  83.         Me.chkpv4.DefaultValue = False
  84.         Me.chkpv5.DefaultValue = False
  85.         Me.chkpv6.DefaultValue = False
  86.  
  87.  End If
  88.  
  89. End Sub
  90.  
Where the chk.... represent the names of different check boxes. This should work. Also makesure that the default value of your check box is set to NO, and not left blank. This can be set by selecting the appropriate check box and looking at its properties.


Thank you for your time. Here is the code I have:
_______________ _______________ _______________ __________
Private Sub Check27_AfterUp date()

' Call MakeFilter

If Check27 = True Then

Me.Check14.Defa ultValue = True

Else

Me.Check14.Defa ultValue = False

End If

End Sub
_______________ _______________ _____________


It hasn't worked for me. What am I doing wrong?
Apr 3 '07 #3
ChaseCox
294 Contributor
have you made sure to set the defualt value of the Check14 is set to NO. This could have something to do with it. Other than that it looks good.
Apr 3 '07 #4

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

Similar topics

3
5165
by: KathyB | last post by:
Hi, I'm trying to find a way to validate input text boxes where I don't know the names until the page is rendered. I've got 2 validate functions that fire with the onsubmit button of a "mini" form within the html document. When the Finish button is clicked, I need to check for any empty input boxes before loading the next aspx page...but it could be no boxes or five boxes, etc.? I've included my html output...if you have any ideas,...
2
3227
by: jimi_xyz | last post by:
Sorry if this isn't the correct group, i don't think there is a group for straight HTML. I am trying to create a type of search engine. There are two radio buttons at the top, in the middle there is a text box, with the search button next to it, and at the bottom there are four check boxes. When the form loads one of the two radio buttons are selected as the default, what i want is when someone clicks on one of the four checkboxes, one of...
0
1957
by: Robert | last post by:
Stephen, I think I figured out the problem. I was able to get Check Boxes and Option Buttons to work on my form by TURNING OFF RECORD SELECTORS on the form. Not sure why this would make a difference. Perhaps Access attributes the hWnd of the form to the Record Selector if these are turned on. In any case, I ran some tests on your Customers form and sure enough, a Check Box or Option Button will work fine until you turn on Record...
6
1953
by: Shannan Casteel via AccessMonster.com | last post by:
I'll explain as well as possible...not an experienced user...but learning. I am working on a database for different kinds of problems with machines. A user will be able to select a problem category from a combo box (i.e. Engine, Fuel, Electrical, Steering, Power Train, Brakes, Hydraulic, Chassis/Structure, etc.). Upon the users selection a series of cooresponding check boxes appears on the form with Problem Subcategories. For instance,...
0
1054
by: megan_c | last post by:
Hi, I have several check boxes on a form which are bound to a database record. I'm having an issue with one of them. After loading and binding the controls, i disable and enable this one(I'll call it chkbox2) based on another check box value(call this one chkbox1). However, on the first click after enabling chkbox2, it is not being checked. After the first click it starts working properly.....any ideas?????
1
1625
by: Java Kumar | last post by:
Hi Friends, I have a form which contains elements such as check boxes,text box,text area ., Problem is in Check boxes. By default, Check boxes are unchecked and text boxes are blank. I clicked one check box and entered some values in text boxes. then After a page refresh, the values of text boxes are cleared.But the check box is appears with check mark. the default value (unchecked) is not restored... Why ? How can i...
5
6732
by: Andrew Meador | last post by:
I have a form (Change Card List by Status) with a check box (cboNOT) and a list box (lstStatus). There is an Open Report button that opens a report (Report - Change Card List) which uses a query (SQL -Change Card List). What I want to do is have the form open the report where a filter is set to use the values from the check box AND the value selected from the list box to generate the report. What I can't figure out is how to use the...
1
1846
by: RP | last post by:
In my Form, I have 20 or 30 Text Boxes and Combo Boxes. I am using a tabbed interface. When the Form's Close button is clicked, I want to check whether user attempted an entry in any of the Text Boxes or not. If yes, a dialog box appears to ask whether user wants to Save the entries or not. There is also a data grid with one Code field that is a primary key. Suppose, a user clicks on any row of the data grid, its column values get...
1
1526
by: Alexio | last post by:
I am a newbie to this and am having a problem with validation and keeping data that has been entered in other fields when submitting the form. For the check boxes, I need a minimum of one selected. If one is not selected, a message box appears notifying that a check box has not been selected. When I click OK, the data in the other text boxes is removed as if the form is being reloaded. How can I prevent this from happening. Is there a better...
0
8435
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8345
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
8857
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8768
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
8547
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
5655
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4348
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1999
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1754
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.