Hi,
I have a form when loaded, retrieves record from an access table. Among
other fields there is a check box called FinalUpdate. This is tied to a field
in Access of type Yes/No.
The form retieves the values perfectly. This form is being used to update
the record in the table via a successconfirmation.asp.
Now, when the checkbox is loaded as checked, then unchecking the checkbox
reflects the change in query result in successconfirmation.asp. However, if
the form is loaded as unchecked, and then the checkbox is checked, the final
query does not change the result. The value of FinalUpdate is still False
though it should be True. Any help is appreciated.
MAIN CODE FOR THE successconfirmation.asp
'Store the values to the local variables
l_ss = Request.Form("txtSocialSecurity")
l_firstname = Request.Form("txtFirstName")
l_lastname = Request.Form("txtLastName")
l_password = Request.Form("txtPassword")
l_colorpreference = Request.Form("txtColorPref")
l_foodpreference = Request.Form("txtFoodPref")
l_finalupdate = CBool(Request.Form("chkFinalUpdate"))
Response.Write l_finalupdate
'Create the dynamic sql script for database update corresponding to
'the current record.
strsql = "UPDATE main SET main.FirstName ='" & l_firstname & "', " & _
"main.LastName = '" & l_lastname & "', " & _
"main.ColorPreference = '" & l_colorpreference & "', " & _
"main.FoodPreference = '" & l_foodpreference & "', " & _
"main.FinalUpdate = " & (l_finalupdate) & " where "
& _
"main.SocialSecurityNumber ='" & l_ss & "'"
Response.Write strsql
MAIN CODE FOR THE LOADING OF INITIAL FORM:
Dim l_SocialSecurityNumber
Dim l_Password
Dim l_FirstName
Dim l_LastName
Dim l_ColorPreference
Dim l_FoodPreference
Dim l_FinalUpdate
'Get all the fields from the database in the above variable
l_SocialSecurityNumber = RS.Fields("SocialSecurityNumber")
l_Password = RS.Fields("Password")
l_FirstName = RS.Fields("FirstName")
l_LastName = RS.Fields("LastName")
l_ColorPreference = RS.Fields("ColorPreference")
l_FoodPreference = RS.Fields("FoodPreference")
l_FinalUpdate = CBool(Rs.Fields("FinalUpdate"))
%>
<div ALIGN="CENTER">
<big> <big><font COLOR="navy">Locking Test</big></big>
</div>
<br><br>
<form ACTION="successconfirmation.asp" method="POST" NAME="frmLockTest">
<table>
<tr>
<td HEIGHT="50" COLSPAN="2"><b><font COLOR="green">Edit Screen</font><b></td>
</tr>
<tr>
<td>Social Security Number</td>
<td><input TYPE="text" NAME="txtSocialSecurity" SIZE="15" value =
"<%Response.Write l_SocialSecurityNumber%>"></td>
<td>First Name</td>
<td><input TYPE="text" NAME="txtFirstName" SIZE="15" value =
"<%Response.Write l_FirstName%>"></td>
<td>Last Name</td>
<td><input TYPE="text" NAME="txtLastName" SIZE="15" value =
"<%Response.Write l_LastName%>"></td>
</tr>
<tr>
<td>Password</td>
<td><input type="password" NAME = "txtPassword" size="15" value =
"<%Response.Write l_Password%>"></td>
<td>Color Preference</td>
<td><input TYPE="text" NAME="txtColorPref" SIZE="15" value =
"<%Response.Write l_ColorPreference%>"></td>
<td>Food Preference</td>
<td><input TYPE="text" NAME="txtFoodPref" SIZE="15"value =
"<%Response.Write l_FoodPreference%>"></td>
</tr>
<tr>
<td>FinalUpdate</td>
<td><input TYPE="checkbox" NAME="chkFinalUpdate" VALUE=
"<%=CBool(l_FinalUpdate)%>"<%If CBool(l_FinalUpdate) Then Response.Write "
checked" Else Response.Write " unchecked"%>></td>
</tr> 3 2318
Your input For the checkbox for is returning "false" when checked because
you are setting its value to the previous value of the data element. Try:
<input TYPE="checkbox" NAME="chkFinalUpdate" VALUE= "true"
<%If CBool(l_FinalUpdate) Then Response.Write " checked"
Else Response.Write " unchecked"%>>
If Trim(Request.Form("chkFinalUpdate")) = "true" Then
l_finalupdate = True
Else
l_finalupdate = False
End If
--
--Mark Schupp
Head of Development
Integrity eLearning www.ielearning.com
"Jack" <Ja**@discussions.microsoft.com> wrote in message
news:B7**********************************@microsof t.com... Hi, I have a form when loaded, retrieves record from an access table. Among other fields there is a check box called FinalUpdate. This is tied to a field in Access of type Yes/No. The form retieves the values perfectly. This form is being used to update the record in the table via a successconfirmation.asp.
Now, when the checkbox is loaded as checked, then unchecking the checkbox reflects the change in query result in successconfirmation.asp. However, if the form is loaded as unchecked, and then the checkbox is checked, the final query does not change the result. The value of FinalUpdate is still False though it should be True. Any help is appreciated.
MAIN CODE FOR THE successconfirmation.asp 'Store the values to the local variables
l_ss = Request.Form("txtSocialSecurity") l_firstname = Request.Form("txtFirstName") l_lastname = Request.Form("txtLastName") l_password = Request.Form("txtPassword") l_colorpreference = Request.Form("txtColorPref") l_foodpreference = Request.Form("txtFoodPref") l_finalupdate = CBool(Request.Form("chkFinalUpdate"))
Response.Write l_finalupdate
'Create the dynamic sql script for database update corresponding to 'the current record.
strsql = "UPDATE main SET main.FirstName ='" & l_firstname & "', " & _ "main.LastName = '" & l_lastname & "', " & _ "main.ColorPreference = '" & l_colorpreference & "', " & _ "main.FoodPreference = '" & l_foodpreference & "', " & _ "main.FinalUpdate = " & (l_finalupdate) & " where " & _ "main.SocialSecurityNumber ='" & l_ss & "'"
Response.Write strsql
MAIN CODE FOR THE LOADING OF INITIAL FORM:
Dim l_SocialSecurityNumber Dim l_Password Dim l_FirstName Dim l_LastName Dim l_ColorPreference Dim l_FoodPreference Dim l_FinalUpdate
'Get all the fields from the database in the above variable
l_SocialSecurityNumber = RS.Fields("SocialSecurityNumber") l_Password = RS.Fields("Password") l_FirstName = RS.Fields("FirstName") l_LastName = RS.Fields("LastName") l_ColorPreference = RS.Fields("ColorPreference") l_FoodPreference = RS.Fields("FoodPreference") l_FinalUpdate = CBool(Rs.Fields("FinalUpdate"))
%>
<div ALIGN="CENTER"> <big> <big><font COLOR="navy">Locking Test</big></big> </div> <br><br> <form ACTION="successconfirmation.asp" method="POST" NAME="frmLockTest"> <table>
<tr> <td HEIGHT="50" COLSPAN="2"><b><font COLOR="green">Edit Screen</font><b></td> </tr>
<tr>
<td>Social Security Number</td> <td><input TYPE="text" NAME="txtSocialSecurity" SIZE="15" value = "<%Response.Write l_SocialSecurityNumber%>"></td>
<td>First Name</td> <td><input TYPE="text" NAME="txtFirstName" SIZE="15" value = "<%Response.Write l_FirstName%>"></td>
<td>Last Name</td> <td><input TYPE="text" NAME="txtLastName" SIZE="15" value = "<%Response.Write l_LastName%>"></td> </tr>
<tr>
<td>Password</td> <td><input type="password" NAME = "txtPassword" size="15" value = "<%Response.Write l_Password%>"></td>
<td>Color Preference</td> <td><input TYPE="text" NAME="txtColorPref" SIZE="15" value = "<%Response.Write l_ColorPreference%>"></td>
<td>Food Preference</td> <td><input TYPE="text" NAME="txtFoodPref" SIZE="15"value = "<%Response.Write l_FoodPreference%>"></td> </tr>
<tr> <td>FinalUpdate</td> <td><input TYPE="checkbox" NAME="chkFinalUpdate" VALUE= "<%=CBool(l_FinalUpdate)%>"<%If CBool(l_FinalUpdate) Then Response.Write " checked" Else Response.Write " unchecked"%>></td> </tr>
Thanks for your generous help. I will test your advise on my application.
Regards.
"Mark Schupp" wrote: Your input For the checkbox for is returning "false" when checked because you are setting its value to the previous value of the data element. Try:
<input TYPE="checkbox" NAME="chkFinalUpdate" VALUE= "true" <%If CBool(l_FinalUpdate) Then Response.Write " checked" Else Response.Write " unchecked"%>>
If Trim(Request.Form("chkFinalUpdate")) = "true" Then l_finalupdate = True Else l_finalupdate = False End If
-- --Mark Schupp Head of Development Integrity eLearning www.ielearning.com
"Jack" <Ja**@discussions.microsoft.com> wrote in message news:B7**********************************@microsof t.com... Hi, I have a form when loaded, retrieves record from an access table. Among other fields there is a check box called FinalUpdate. This is tied to a field in Access of type Yes/No. The form retieves the values perfectly. This form is being used to update the record in the table via a successconfirmation.asp.
Now, when the checkbox is loaded as checked, then unchecking the checkbox reflects the change in query result in successconfirmation.asp. However, if the form is loaded as unchecked, and then the checkbox is checked, the final query does not change the result. The value of FinalUpdate is still False though it should be True. Any help is appreciated.
MAIN CODE FOR THE successconfirmation.asp 'Store the values to the local variables
l_ss = Request.Form("txtSocialSecurity") l_firstname = Request.Form("txtFirstName") l_lastname = Request.Form("txtLastName") l_password = Request.Form("txtPassword") l_colorpreference = Request.Form("txtColorPref") l_foodpreference = Request.Form("txtFoodPref") l_finalupdate = CBool(Request.Form("chkFinalUpdate"))
Response.Write l_finalupdate
'Create the dynamic sql script for database update corresponding to 'the current record.
strsql = "UPDATE main SET main.FirstName ='" & l_firstname & "', " & _ "main.LastName = '" & l_lastname & "', " & _ "main.ColorPreference = '" & l_colorpreference & "', " & _ "main.FoodPreference = '" & l_foodpreference & "', " & _ "main.FinalUpdate = " & (l_finalupdate) & " where " & _ "main.SocialSecurityNumber ='" & l_ss & "'"
Response.Write strsql
MAIN CODE FOR THE LOADING OF INITIAL FORM:
Dim l_SocialSecurityNumber Dim l_Password Dim l_FirstName Dim l_LastName Dim l_ColorPreference Dim l_FoodPreference Dim l_FinalUpdate
'Get all the fields from the database in the above variable
l_SocialSecurityNumber = RS.Fields("SocialSecurityNumber") l_Password = RS.Fields("Password") l_FirstName = RS.Fields("FirstName") l_LastName = RS.Fields("LastName") l_ColorPreference = RS.Fields("ColorPreference") l_FoodPreference = RS.Fields("FoodPreference") l_FinalUpdate = CBool(Rs.Fields("FinalUpdate"))
%>
<div ALIGN="CENTER"> <big> <big><font COLOR="navy">Locking Test</big></big> </div> <br><br> <form ACTION="successconfirmation.asp" method="POST" NAME="frmLockTest"> <table>
<tr> <td HEIGHT="50" COLSPAN="2"><b><font COLOR="green">Edit Screen</font><b></td> </tr>
<tr>
<td>Social Security Number</td> <td><input TYPE="text" NAME="txtSocialSecurity" SIZE="15" value = "<%Response.Write l_SocialSecurityNumber%>"></td>
<td>First Name</td> <td><input TYPE="text" NAME="txtFirstName" SIZE="15" value = "<%Response.Write l_FirstName%>"></td>
<td>Last Name</td> <td><input TYPE="text" NAME="txtLastName" SIZE="15" value = "<%Response.Write l_LastName%>"></td> </tr>
<tr>
<td>Password</td> <td><input type="password" NAME = "txtPassword" size="15" value = "<%Response.Write l_Password%>"></td>
<td>Color Preference</td> <td><input TYPE="text" NAME="txtColorPref" SIZE="15" value = "<%Response.Write l_ColorPreference%>"></td>
<td>Food Preference</td> <td><input TYPE="text" NAME="txtFoodPref" SIZE="15"value = "<%Response.Write l_FoodPreference%>"></td> </tr>
<tr> <td>FinalUpdate</td> <td><input TYPE="checkbox" NAME="chkFinalUpdate" VALUE= "<%=CBool(l_FinalUpdate)%>"<%If CBool(l_FinalUpdate) Then Response.Write " checked" Else Response.Write " unchecked"%>></td> </tr>
Gazing into my crystal ball I observed "Mark Schupp" <no******@email.net>
writing in news:eT**************@TK2MSFTNGP10.phx.gbl: <input TYPE="checkbox" NAME="chkFinalUpdate" VALUE= "true" <%If CBool(l_FinalUpdate) Then Response.Write " checked" Else Response.Write " unchecked"%>>
HTML:
<%If condition = true then%>checked<%end if%>
XHTML
<%If condition = true then%>checked="checked"<% end if%>
There is no such attribute as "unchecked". I realise that's client side,
but it's important to know, especially if you are serving documents as
application/xhtml+xml to compliant browsers.
--
Adrienne Boswell
Please respond to the Group so others can share This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Paris_Sucks |
last post by:
I'm trying to redirect when testing for certain condidtions as shown
below. When the conditions are ture, it redirects, but still goes ahead and
processes the sql query. What am I doing wrong??? ...
|
by: Tongu? Yumruk |
last post by:
I have a little proposal about type checking in python. I'll be glad
if you read and comment on it. Sorry for my bad english (I'm not a
native English speaker)
A Little Stricter Typing in Python...
|
by: Marlene Stebbins |
last post by:
I am entering numbers into my program from the command line. I want to
check whether they are > INT_MAX. Sounds simple, but I've discovered that
if(x <= INT_MAX)
{
/* use x in some calculation...
|
by: Fuzzydave |
last post by:
Okay, I have been handed a python project and working through it I have
had to add a report. I am returning 10 variables the results of an SQL
Query
and as usual the number of results vary from...
|
by: lawrence k |
last post by:
I've made it habit to check all returns in my code, and usually, on
most projects, I'll have an error function that reports error messages
to some central location. I recently worked on a project...
|
by: mookid |
last post by:
Hello,
I am new to PHP so I have done a research on how to check if an entry
exists on the table. I came up with the following code:
include("dbinfo.inc.php");
$Name=$_POST;
$Code=$_POST;...
|
by: Phil Latio |
last post by:
I am inserting data into user table which contains 5 fields, sounds simple
enough normally but 2 of the fields are designated as UNIQUE. If someone
does enter a value which already exists, how do I...
|
by: Edwina Rothschild |
last post by:
Hello,
I am new to PHP so I have done a research on how to check if an entry
exists on the table. I came up with the following code:
include("dbinfo.inc.php");
$Name=$_POST;
$Code=$_POST;...
|
by: sprash |
last post by:
Newbie question:
I'm trying to determine if a file physically exists regardless of the
permissions on it
Using File.Exists() returns false if it physically exists but the
process does not...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| |