472,800 Members | 1,289 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,800 software developers and data experts.

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 3140

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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: thejackofall | last post by:
Hi. This little thing is killing me. I have CheckBoxes in a DataGrid as below. When user pushes a submit button, I want to know what CheckBoxes are checked. However, in the submit button...
3
by: Jack | last post by:
<i><input type="checkbox" name="chk_Complete" value="TRUE" <%Response.Write l_IsChecked%>"<%if cbool(l_IsChecked) then Response.Write " checked" Else Response.Write " unchecked"%>> The above...
2
by: Kufre | last post by:
I need anyone that have done this before to help me. I'm creating a form in Access, in the form has two two checkbox, checkbox A is paid, checkbox B is partial_paid. I want the set the checkbox so...
1
by: Ramakrishnan Nagarajan | last post by:
Hi, I have two checkboxes in each row of a grid. One for Modify and another one for View. If I click Modify the View should get automatically checked and should be disabled. Earlier I did this in...
6
by: hazz | last post by:
ICollection CreateDataSource() { dt.Columns.Add(new DataColumn("ReportInclude", typeof(Boolean))); for (int i=0; i<=10; i++) { dr = dt.NewRow(); dr = 0; dt.Rows.Add(dr); } void...
2
by: justplain.kzn | last post by:
Hi, I have a table with dynamic html that contains drop down select lists and readonly text boxes. Dynamic calculations are done on change of a value in one of the drop down select lists. ...
1
by: since | last post by:
I figured I would post my solution to the following. Resizable column tables. Search and replace values in a table. (IE only) Scrollable tables. Sortable tables. It is based on a lot...
1
by: arggg | last post by:
I have an external html that is a form. the Values of the form elements have <?= $results ?> type information however with file_get_contents in the main php file that then stores the contents to a...
1
by: joecosmides | last post by:
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...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: lllomh | last post by:
How does React native implement an English player?
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.