Solved

Form Checkboxes Yes / No

Posted on 2015-01-23
3
168 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
3 Comments
 
LVL 82

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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Suggested Solutions

I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

760 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now