CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> ASP

 Update a field in a table only for the multiple values selected in the listbox

Print topic Send  topic

Author Message
sjgrodriguez

Posts: 26
Posted: 08/23/2010, 3:27 AM

Hi there.

I have a table called MUESTRAS , with 3 fields: field ID, a field called SAMPLE_CODE , integer, and another field called SENT, boolean, true/false.

I have an asp page with a listbox in a form called "C_ACTA_ENTREGA",. with multiple values selection done, for the field ID.

I have done an On_Click Event, to Update the field SENT from False to True, only for the SAMPLES selected in the listbox.

The problem is that the Onclick event code doesn´t work properly. It only updates the first SAMPLE code, not the multiple selection.

The code used is:

Dim Connection
Set Connection = New clsDBCALIDAD_AGUAS
Connection.Open
Connection.Execute("UPDATE SAMPLE_CODE SET SENT=True WHERE ID IN (" & C_ACTA_ENTREGA1.s_COD_MUESTRA_CLC.Value & ")")
'Connection.Execute("UPDATE MUESTRAS SET ENTREGADA=False")
Connection.Close
Set Connection = Nothing

As i say, if i select in the listbox, for example, three values, 30, 31 and 32, it only updates my the first one, 30. It´s like the "IN" statement is not well done...

Please it would be great if i get some help.

Thanks in advance.

Regards,

Sergio
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.