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

Discussion in 'ASP General' started by joecosmides@gmail.com, Nov 19, 2008.

  1. Guest

    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>
    , Nov 19, 2008
    #1
    1. Advertising

  2. Mike Brind Guest

    <> wrote in message
    news:...
    >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
    Mike Brind, Nov 20, 2008
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Siemel Naran

    Does true ^ true return false?

    Siemel Naran, Jun 17, 2004, in forum: C++
    Replies:
    19
    Views:
    660
    Chris Theis
    Jun 18, 2004
  2. André
    Replies:
    3
    Views:
    1,574
  3. Ted
    Replies:
    1
    Views:
    408
  4. Replies:
    2
    Views:
    1,361
    Paul Shapiro
    Nov 20, 2008
  5. bdb112
    Replies:
    45
    Views:
    1,334
    jazbees
    Apr 29, 2009
Loading...

Share This Page