Solved

Form Checkboxes Yes / No

Posted on 2015-01-23
3
177 Views
Last Modified: 2015-01-24
I have a simple update form with data being stored in an MSAccess database.
The checkboxes are recording a "Yes" when the user checks the appropriate selection.
If the user unchecks one of the checkbox that was checked, a -1 gets stored in the database.

How do I get a "NO" or delete the "Yes" when the user unchecks the box.

My code for the checkbox is

	<input type="checkbox" name="Dialog" value="Yes" <%If Dialog = "Yes" then response.write "checked" End If%>><font size="2">Dialog<br>

Open in new window

0
Comment
Question by:Malloy1446
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 40567455
The problem with checkboxes is that if they are not checked, they are not included in the submit data.  I would set the default value to '-1' and only change it if the "Dialog" value of 'Yes' is submitted.
0
 
LVL 47

Assisted Solution

by:Dale Fye (Access MVP)
Dale Fye (Access MVP) earned 150 total points
ID: 40567456
Actually, if the field in the database is a Yes/No field, then when the user checks the check-box, the value should be -1 and when it is unchecked, the value should be 0.
0
 
LVL 74

Accepted Solution

by:
Jeffrey Coachman earned 350 total points
ID: 40567813
If I am understanding your request correctly...
If you want to actually display a "Yes" or "No"...
You can create a textbox on your form/report, with a control source of:
    =IIf([YourYesNoField]=-1,"Yes","No")

There can be many refinements of this basic technique (VBA If/Then/else or Select-case, Combobox lookup, ...etc)
But this might start you off...

JeffCoachman
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Hta File displays dynamic File names 4 50
HTML INPUT 6 21
w3c parsing errors 4 20
aria difference 2 15
Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
Originally, this post was published on Monitis Blog, you can check it here . Websites are getting bigger and more complicated by the day. Video, images and custom fonts are all great for showcasing your product or service. But the price to pay in…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question