newbie2
Tri state check box in table not saving third state (on turtorial,express version) July 31, 2017 12:49AM |
newbie2
Re: Tri state check box in table not saving third state (on turtorial,express version) July 31, 2017 09:26AM |
Allard
Re: Tri state check box in table not saving third state (on turtorial,express version) July 31, 2017 09:38AM |
DerekT
Re: Tri state check box in table not saving third state (on turtorial,express version) July 31, 2017 11:11AM |
status = TABLE_Time[TableSelect(TABLE_Time)][1]..Value
status = Myself..Value
newbie2
Re: Tri state check box in table not saving third state (on turtorial,express version) July 31, 2017 11:34AM |
newbie2
Re: Tri state check box in table not saving third state (on turtorial,express version) July 31, 2017 12:00PM |
DerekT
Re: Tri state check box in table not saving third state (on turtorial,express version) July 31, 2017 12:24PM |
Fabrice Harari
Re: Tri state check box in table not saving third state (on turtorial,express version) July 31, 2017 12:58PM |
newbie2
Re: Tri state check box in table not saving third state (on turtorial,express version) July 31, 2017 01:26PM |
DerekT
Re: Tri state check box in table not saving third state (on turtorial,express version) July 31, 2017 02:09PM |
Fabrice Harari
Re: Tri state check box in table not saving third state (on turtorial,express version) July 31, 2017 03:29PM |
DerekT
Re: Tri state check box in table not saving third state (on turtorial,express version) July 31, 2017 04:02PM |
Fabrice Harari
Re: Tri state check box in table not saving third state (on turtorial,express version) July 31, 2017 10:01PM |
newbie2
Re: Tri state check box in table not saving third state (on turtorial,express version) July 31, 2017 11:31PM |
DerekT
Re: Tri state check box in table not saving third state (on turtorial,express version) August 01, 2017 01:43AM |
newbie2
Re: Tri state check box in table not saving third state (on turtorial,express version) August 01, 2017 02:10AM |
newbie2
Re: Tri state check box in table not saving third state (on turtorial,express version) August 01, 2017 02:59AM |
DerekT
Re: Tri state check box in table not saving third state (on turtorial,express version) August 01, 2017 10:52AM |
DerekT
Re: Tri state check box in table not saving third state (on turtorial,express version) August 01, 2017 11:19AM |
Quote
newbie2
i was sure i solved it....
buth it only seems to work with manueel input if i use the code to mark row 3 to state -1 its stil not saving
@DerekT the subtype combox drop down only gives me 1 more option other then checkbox >unsigned intreger
nCc1=TableSelect(TABLE_Time,1,tsRow)
nCc2=TABLE_Time.COL_Onoroff[nCc1]
IF nCc2 = -1 THEN
TABLE_Time.COL_Onoroff[3]=-1
ScreenToFile(newww,TABLE_Time)
END
the intention was whenever any row of the colum onorof is modified. check state if state is -1 if -1 then change all the states of the rows that contain the same group name.
in order to do that i was using the above code to see if it saves 1 change in state before writing more
IF MySelf..Value <> -1 THEN
//Call local procedure
lpUpdateTriState()
END
PROCEDURE lpUpdateTriState()
// For each row containing the target group name
FOR EACH ROW OF Table1 WHERE Column4 = "Group"
// Update the TriState checkbox
IF Column1..Value = -1 THEN
Column1..Value = 1
END
END
newbie2
Re: Tri state check box in table not saving third state (on turtorial,express version) August 01, 2017 12:00PM |
DerekT
Re: Tri state check box in table not saving third state (on turtorial,express version) August 01, 2017 12:39PM |
Quote
newbie2
@Derekt
Before this post i didint know u could link a nummeric with a checkbox control i tought it always had to be same subtype as the key subtype ;like a date key linked to edt field configured as date type.....so when i tried the meta type thing i had no idee why it worked (partialy) and since it only worked in part i tought i still did it wrong....you where explaining another methode i didint quit get until the linked image
Buth i still dont get why the changed state doessent get stored
nCc1=TableSelect(TABLE_Time,1,tsRow)// gets colom row
nCc2=TABLE_Time.COL_Onoroff[nCc1]//gets value of cell
IF nCc2 = -1 THEN //if selected row
TABLE_Time.COL_Onoroff[3]=-1//test to see if i can change and write down the change
ScreenToFile(newww,TABLE_Time)
END
i tested h modify and h add aswell its still refusing to work h add works buth h modify does not.I have been addit for hours now at the point i am now trying work arounds because it still doesent work like it should or at least i cant get it to work (sure it stores when i click on it buth if i cant manipulate the states bye code and save them .its useless to me;a wise men once said : Insanity Is Doing the Same Thing Over and Over Again and Expecting Different Results . I tried evrything i could think of still ......
// Update the TriState checkbox
IF Column1..Value = -1 THEN
Column1..Value = 1
TableSave(Table1) //The row in question does need to be selected
END
newbie2
Re: Tri state check box in table not saving third state (on turtorial,express version) August 01, 2017 01:42PM |
DerekT
Re: Tri state check box in table not saving third state (on turtorial,express version) August 01, 2017 03:38PM |
IF MySelf..Value <> -1 THEN
//Call local procedure
lpUpdateTriState()
END
The procedure will now use the query
PROCEDURE lpUpdateTriState()
s_GroupName is ANSI string = Table_Test.GroupName..Value //Name of the group
s_TblSaveInfo is ANSI string
s_TblSaveInfo = TableSavePositionAndSelection(Table_Test) //Stores the position of the slected row
HExecuteQuery(UPD_Query1,hQueryDefault+hModifyFile,s_GroupName) //Executes the query - Note use of hModifyFile
TableDisplay(Table_Test) // Refreshes the table display - new values will be visible
TableRestorePositionAndSelection(Table_Test,s_TblSaveInfo) //Returns to the previous position and selects the record
END
HFreeQuery(UPD_Query1) //Release memory
The query can be generated in the Query Generator, the SQL code will look similar to
UPDATE
TriBoxTest
SET
OnOrOff = 1
WHERE
TriBoxTest.OnOrOff = -1
AND TriBoxTest.GroupName = {psGroup}
newbie2
Re: Tri state check box in table not saving third state (on turtorial,express version) August 03, 2017 08:21PM |
PROCEDURE lpUpdateTriState() s_GroupName is ANSI string = TABLE_Time.COL_Group..Value //Name of the group s_TblSaveInfo is ANSI string IF s_TblSaveInfo = TableSavePositionAndSelection(TABLE_Time) THEN HExecuteQuery(QRY_NoName2,hQueryDefault+hModifyFile,s_GroupName) //Executes the query - Note use of hModifyFile TableDisplay(TABLE_Time) // Refreshes the table display - new values will be visible TableRestorePositionAndSelection(TABLE_Time,s_TblSaveInfo) //Returns to the previous position and selects the record END HFreeQuery(QRY_NoName2) //Release memory
UPDATE //SQL code TriBoxTest SET onoroff = 1 WHERE TriBoxTest.onoroff = -1 AND TriBoxTest.GroupName = {psGroup}
//call code whenever col onorof modified IF MySelf..Value <> -1 THEN //Call local procedure lpUpdateTriState() ENDI noticed in the SQL u dont seem to call on the data fille is that because u load it in to memory in the local procedure?(again first step query here)