473,385 Members | 1,769 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,385 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 4114
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...

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.