1

(4 replies, posted in Script)

thanks for the reply.  doing a Tablegrid delete makes it more robust, id probably post on how to do it in the future so you saved both of us some time smile  thanks again

2

(4 replies, posted in Script)

i want to delete all rows in table (not the table).  From a Button I use the Action, 'SQL Query', "Delete FROM userAnswers";

if i select the 2 table options below i get this error (see attachment).
i also get the same errors if i run it directly from a Script.

form1.tablegrid2.dbSQL := 'Delete From userAnswers';
form1.tablegrid2.dbSQLExecute;

If i leave these 2 options blank, no error and the data rows ARE deleted from db Table... BUT the TableGrid2 component doesnt run the Auto Query

even though the db Table doesnt have data, I still want to Column Names to appear in my TableGrid.

i did OnClick precedure from the same Button and ran
if Form1.TableGrid2.dbSQL <> '' then Form1.TableGrid2.dbSQLExecute; 

but still same result, doesnt auto update

what the best solution?  thanks

3

(12 replies, posted in Script)

both methods work.

thanks for the quick replies

4

(12 replies, posted in Script)

procedure checkBoxTest (Sender: TObject);

regarding the proceduer you provided... it works as expected but need to add another functionality...

i have the Submit button below the checkboxes.  The submit button saves the choice to the database AND i also want to reset the checkboxes to Unchecked...  i tried several ways but it seems the Checked Box cannot be UnChecked (at least I cant)

i tried the same looping Components as an OnClick for the submit button but cannot get it to work. 

Given this procedure you provided.  If I press the Submit button how can I reset all the CheckBoxes to Unchecked?

for i:=0 to Form2.ComponentCount-1 do
      if TdbCheckBox(Form2.Components[i] is TdbCheckBox) then
              if tdbCheckbox(form2.components[i]).State = cbChecked then
                  tdbCheckbox(form2.components[i]).State = cbUnchecked;

attached is the program.  thanks for the help

5

(12 replies, posted in Script)

thanks, it makes sense now...

wish there was a way to give a thumbs up or mark as solved. no big deal thought

6

(12 replies, posted in Script)

quick question regarding the procedure

i see Sendeer alot within the script...  TdbCheckBox(Sender)

how do i interpret 'Sender'.  thnaks

7

(12 replies, posted in Script)

procedure checkBoxTest (Sender: TObject);

thank you for the reply, it works great.

8

(12 replies, posted in Script)

Hello, i have 4 checkboxes and I only want to be able to select 1 of the 4.  So if i select checkbox 1 then I select checkbox 2, checkbox 1 will automatically deselect.

here is the project attached. i wrote a seperate 'Onclick' for each checkbox  but i cant get it to work, any ideas?

\\sample procedure
procedure Two_form2_CheckBox2 (Sender: TObject);
begin
Sleep(300);
form2.Checkbox1.State := cbUnchecked;
form2.CheckBox3.State := cbUnchecked;
form2.CheckBox4.State := cbUnchecked;
end;