Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > ASP/Html checkbox convert to true/false for MS Access backend.

Reply
Thread Tools

ASP/Html checkbox convert to true/false for MS Access backend.

 
 
joecosmides@gmail.com
Guest
Posts: n/a
 
      11-19-2008
I have a microsoft access front end and backend database for multi-
user use. I have the back end located on a server that also is an IIS
webserver. I've created a few ASP pages that pull customer lists down
so far and it works great. I am trying to edit some of that data and
noticed that a checkbox on the webpage uses ON/OFF instead of True/
False like MS Access uses. My problem is trying to get the checkbox to
be checked if the data in the field called "ServiceCallBack" is pulled
and shown to be True. If False then it would uncheck the box.

Here is the code I have on that webpage:

<%

ID = Request("ID")
ID = CLng(ID)

%>
<!--#include file="database-connect.asp"-->
<%
SQL = "SELECT * FROM Support2Q WHERE LeadDetailID=" & ID
RS.Open SQL, Conn

ServiceNotes = rs("ServiceNotes")
ServiceCallBack = rs("ServiceCallBack")
ServiceCallBackTime = rs("ServiceCallBackTime")
Customer = rs("Customer")
ContractorName = rs("ContractorName")


%>
<!--#include file="database-disconnect.asp"-->

<html>
<body>

<form method="POST" action="editprocess.asp">
<tr>
<td width="130">LeadDetailID:</td>
<td width="267"><input type="hidden" name="ID" value="<%=ID%>"
size="25"></td>
<p>
</tr>
<tr>
<td width="130">Customer:</td>
<td width="267">
<input type="text" name="Customer" value="<%=Customer%>"
size="57"></td>
</tr>
<tr>
<td width="130">&nbsp;&nbsp;&nbsp; </p>
<p>
Contractor Name:</td>
<td width="267">
<input type="text" name="ContractorName" value="<%=ContractorName
%>" size="50"></td></p>
<p>
Notes: <textarea rows="8" name="ServiceNotes" cols="86"><
%=ServiceNotes%></textarea></p>

<p>Call Back?
<input type="checkbox" name="ServiceCallBack" value="<
%=ServiceCallBack%>"></p>

<p>Call Back When?</td>
<td width="267"><input type="text" name="ServiceCallBackTime"
value="<%=ServiceCallBackTime%>" size="50"></td></p>

<p><input type="submit" value="Submit" name="B1"></p>
</form>
</body>
</html>
 
Reply With Quote
 
 
 
 
Mike Brind
Guest
Posts: n/a
 
      11-20-2008

<(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>I have a microsoft access front end and backend database for multi-
> user use. I have the back end located on a server that also is an IIS
> webserver. I've created a few ASP pages that pull customer lists down
> so far and it works great. I am trying to edit some of that data and
> noticed that a checkbox on the webpage uses ON/OFF instead of True/
> False like MS Access uses. My problem is trying to get the checkbox to
> be checked if the data in the field called "ServiceCallBack" is pulled
> and shown to be True. If False then it would uncheck the box.
>
> Here is the code I have on that webpage:
>
> <%
>
> ID = Request("ID")
> ID = CLng(ID)
>
> %>
> <!--#include file="database-connect.asp"-->
> <%
> SQL = "SELECT * FROM Support2Q WHERE LeadDetailID=" & ID
> RS.Open SQL, Conn
>
> ServiceNotes = rs("ServiceNotes")
> ServiceCallBack = rs("ServiceCallBack")
> ServiceCallBackTime = rs("ServiceCallBackTime")
> Customer = rs("Customer")
> ContractorName = rs("ContractorName")
>
>
> %>
> <!--#include file="database-disconnect.asp"-->
>
> <html>
> <body>
>
> <form method="POST" action="editprocess.asp">
> <tr>
> <td width="130">LeadDetailID:</td>
> <td width="267"><input type="hidden" name="ID" value="<%=ID%>"
> size="25"></td>
> <p>
> </tr>
> <tr>
> <td width="130">Customer:</td>
> <td width="267">
> <input type="text" name="Customer" value="<%=Customer%>"
> size="57"></td>
> </tr>
> <tr>
> <td width="130">&nbsp;&nbsp;&nbsp; </p>
> <p>
> Contractor Name:</td>
> <td width="267">
> <input type="text" name="ContractorName" value="<%=ContractorName
> %>" size="50"></td></p>
> <p>
> Notes: <textarea rows="8" name="ServiceNotes" cols="86"><
> %=ServiceNotes%></textarea></p>
>
> <p>Call Back?
> <input type="checkbox" name="ServiceCallBack" value="<
> %=ServiceCallBack%>"></p>
>
> <p>Call Back When?</td>
> <td width="267"><input type="text" name="ServiceCallBackTime"
> value="<%=ServiceCallBackTime%>" size="50"></td></p>
>
> <p><input type="submit" value="Submit" name="B1"></p>
> </form>
> </body>
> </html>


<p>Call Back?
<input type="checkbox" name="ServiceCallBack" value="-1" <% If
ServiceCallBack = -1 Then Response.Write " ""checked""" %>>
</ p>

--
Mike Brind
MVP - ASP/ASP.NET


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ASP/Html checkbox convert to true/false for MS Access backend joecosmides@gmail.com ASP .Net 2 11-20-2008 01:25 AM
DataGrid and embeded Checkbox..How to find if checkbox clicked =?Utf-8?B?RG90TmV0RGV2?= ASP .Net 1 10-06-2006 04:11 PM
disable checkbox list checkbox Vikram ASP .Net 1 01-25-2006 02:59 PM
Text on Checkbox below the checkbox tshad ASP .Net 0 04-14-2005 11:26 PM
Convert an MS Access Yes/No column to a checkbox column in C# datagrid Gregory Rampton ASP .Net Datagrid Control 0 08-06-2003 04:09 PM



Advertisments