Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Checkboxes in Access 97 Table

Status
Not open for further replies.

GWPhoenix

IS-IT--Management
Jun 26, 2001
32
0
0
US
This may be pretty basic, but here goes --

I have a table in Access 97 that is a yes/no checkbox where if the box is checked, it means "yes".

My HTML document shows:

Code:
<tr><TD>Pref EZ/EC?</TD><td><INPUT TYPE=CHECKBOX NAME=&quot;prefezec&quot; VALUE=&quot;yes&quot;></TD></TR>

and in the asp &quot;update&quot; my error points to the line reading

Code:
objRS(&quot;prefezec&quot;) = Request.Form(&quot;prefezec&quot;)

With the following error:

Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.

When I wish to display this code in a table, this property hangs up again. The phrase

Code:
	 If objRS(&quot;prefezec&quot;) = &quot;yes&quot; Then 
		Response.Write &quot;<TD> X </TD>&quot;
	Else 
		Response.Write &quot;<TD>  </TD>&quot;
	End if

never gets the X where it should be. I have tried objRS(&quot;prefezec&quot;) <> &quot;whatever&quot; and gotten the &quot;X&quot; to display everywhere.

Any ideas? This is driving me nuts.
 
A yes/no field in Access is really a true/false field. True would display as Yes only if that control is formatted that way. Test the field as follows:

If objRS(&quot;prefezec&quot;) = True Then
...

And when you store the value of the checkbox, if it's checked set the field to True, not &quot;Yes&quot;.

Caveat: The above works in VBA, I don't know about Java or VBScript, or whatever you're using.
&quot;The Key, The Whole Key, and Nothing But The Key, So Help Me Codd!&quot;
 
Yes! It worked! Thank you! Time for dancing in the streets!

:)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top