473,320 Members | 2,112 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,320 software developers and data experts.

Unchecking check boxes and text boxes in a form

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 4112
ChaseCox
294 100+
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
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_AfterUpdate()

' Call MakeFilter

If Check27 = True Then

Me.Check14.DefaultValue = True

Else

Me.Check14.DefaultValue = False

End If

End Sub
___________________________________________


It hasn't worked for me. What am I doing wrong?
Apr 3 '07 #3
ChaseCox
294 100+
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
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...
2
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...
0
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...
6
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...
0
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...
1
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...
5
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...
1
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...
1
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....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.