472,328 Members | 2,044 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,328 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 4023
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...
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...
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...
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...
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...
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...
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...
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...
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...
0
by: tammygombez | last post by:
Hey fellow JavaFX developers, I'm currently working on a project that involves using a ComboBox in JavaFX, and I've run into a bit of an issue....
0
better678
by: better678 | last post by:
Question: Discuss your understanding of the Java platform. Is the statement "Java is interpreted" correct? Answer: Java is an object-oriented...
0
by: teenabhardwaj | last post by:
How would one discover a valid source for learning news, comfort, and help for engineering designs? Covering through piles of books takes a lot of...
0
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: CD Tom | last post by:
This happens in runtime 2013 and 2016. When a report is run and then closed a toolbar shows up and the only way to get it to go away is to right...
0
by: CD Tom | last post by:
This only shows up in access runtime. When a user select a report from my report menu when they close the report they get a menu I've called Add-ins...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...

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.