469,946 Members | 1,805 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,946 developers. It's quick & easy.

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

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.

Thanks,

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>
Nov 19 '08 #1
2 3001

This is a newsgroup for asp.NET , not "classic" asp.

However, you did remind me how VERY THANKFUL I am for Asp.Net.

..........

You'll find better luck in another newsgroup.

Maybe this one:
microsoft.public.inetserver.asp.general

<jo*********@gmail.comwrote in message
news:a6**********************************@d10g2000 pra.googlegroups.com...
>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.

Thanks,

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>


Nov 19 '08 #2
Here is code I used in an ASP project. I built the html completely in code,
but the key part seems to be using the HTML "checked" setting for a check
box. In Access a boolean attribute has a value of 0 for False, Off, No, etc.
and -1 for True, On, Yes. The names are just part of the display format, not
the real data.

strHTML = strHTML & "<tr>" & vbcrlf & _
"<td>Invited Paper?</td>" & vbCrLf & _
"<td><INPUT type=checkbox name=chkInvited "
if fInvited then
strHTML = strHTML & "checked" & vbcrlf
end if

<jo*********@gmail.comwrote in message
news:a6**********************************@d10g2000 pra.googlegroups.com...
>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.

Thanks,

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>

Nov 20 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by thejackofall | last post: by
2 posts views Thread by Kufre | last post: by
1 post views Thread by Ramakrishnan Nagarajan | last post: by
2 posts views Thread by justplain.kzn | last post: by
1 post views Thread by arggg | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.