Home > database >  Button and SQL data window
Button and SQL data window

Time:09-30

There is a table SQL database
A | B
001 YES
002 NO
003 YES
004 YES
005 NO
006 YES
Now I have six in the data window button B_001, B_002 B_003... B_006
Corresponding to A value of 001002003 in the table... 006
When I open the window according to table A and B values if YES button is red if NO blue
This how to achieve?

CodePudding user response:

Suggest put the button in the window, and not the data window.

And then determine the value of b, to YES, setting enabled=true, to no, setting enabled=false

CodePudding user response:

reference 1st floor dawugui response:
suggest put the button in the window, and not the data window.

And then determine the value of b, to YES, set the enabled=true, set to no, enabled=false


Suggestion is worth reference

CodePudding user response:

 Long I 
String ls_a, ls_b

FOR I=1 To dw_1. RowCount ()
Ls_a=dw_1. GetItemString (I, 'a')
Ls_b=dw_1. GetItemString (I, 'b')
IF ls_b='YES' THEN
Dw_1. Modify (' b_ + ls_a + 'color=' + String (RGB (255, 0, 0)))//red
The ELSE
Dw_1. Modify (' b_ + ls_a + 'color=' + String (RGB (0, 0, 255)))//blue
END the IF
NEXT

CodePudding user response:

 Long I 
String ls_a, ls_b

FOR I=1 To dw_1. RowCount ()
Ls_a=dw_1. GetItemString (I, 'a')
Ls_b=dw_1. GetItemString (I, 'b')
IF ls_b='YES' THEN
Dw_1. Modify (' b_ + ls_a + 'color=' + String (RGB (255, 0, 0)))
The ELSE
Dw_1. Modify (' b_ + ls_a + 'color=' + String (RGB (0, 0, 255)))
END the IF
NEXT

CodePudding user response:

The
reference 3 floor jimwoo response:
SQL codeLong I
String ls_a, ls_b

FOR I=1 To dw_1. RowCount ()
Ls_a=dw_1. GetItemString (I, 'a')
Ls_b=dw_1. GetItemString (I, 'b')
IF ls_b='YES' THEN
Dw_1. Modify (' b_ + ls_a + 'color=' + String (RGB (255, 0, 0)))//red
The ELSE
Dw_1. Modify (' b_ + ls_a + 'color=' + String (RGB (0, 0, 255)))//blue
END the IF
NEXT
ding
  • Related