|
I have a pretty simple kixform (classic) project that I am struggling with. I think that Im doing it wrong. I have a form with a textbox() that I want type a description into. Later in the script I want to press an "Update" button and have it update a sql table with the value that I typed into the textbox(). If I hard code the text $textbox1.text = 'Description of updated value' it will work. If I type directly into the textbox() then the variable of $textbox1.text is blank when I press "Update". I added a button "Select" and have it displaying the values of the text boxes. They are all blank. I am thinking that I am doing it incorrectly. I will post the entire script if anyone wants to look. Below is just a few snips from it.
______________________________________________________ Dim $TextBox1 $TextBox1 = $UnitDescription.Controls.TextBox() $TextBox1.Location = 17, 25 $TextBox1.BackColor = "White" $TextBox1.Size = 367, 333 ______________________________________________________ Function SelectButtonOnClick() ? 'Select Button has been pressed' ? 'TextBox1=' $TextBox1.text ? 'Combobox1=' $ComboBox1.text ? 'Combobox2=' $ComboBox2.text EndFunction ______________________________________________________
Function UpdateButtonOnClick() If $TextBox1.Text <> "" $description = $TextBox1.Text Else $description = "NO TEXT FOR UPDATE" EndIf
$sqlServerTable = 'AvailableSpace' $ConnDSN = ('DRIVER={SQL Server};SERVER=XXXXXX;UID=XX;PWD=XXXXXXXX;DATABASE=PacTrust_Web') $PsCode = '1obp108' $UsCode = '02-16200' $sql = ("UPDATE " + $sqlServerTable + " Set Caption3 = " + Chr(39) + $Description + Chr(39) + " where uscode = " + Chr(39) + $UsCode + Chr(39) + " And pscode = " + Chr(39) + $PsCode + "'") $recordset = DBCommand($ConnDSN, $sql)
EndFunction
Edited by mikef001 (2014-01-27 11:09 PM)
|