Alpha Video Training
Results 1 to 3 of 3

Thread: Poblem with a simple checkbox, what am I missing !!

  1. #1
    Member Graham Wickens's Avatar
    Real Name
    Graham Wickens
    Join Date
    Apr 2000
    Location
    Gloucestershire, UK
    Posts
    795

    Default Problem with a simple checkbox, what am I missing !!

    Sorry Guys,

    Been going around in circles with this for the last four hours and getting nowhere.

    stripped out the code to make it as simple as I can.

    I ask for a value for vReg, the status of the checkbox (true/false) determines which value to set vFilter.

    Code:
    dim regflag as l = .f.
    dim vReg as c
    dim vFilter as c
    ui_modeless_dlg_box("Query Selection",<<%dlg%
    {Background=#234+234+255}
    {removecomments}
    {font=Arial,9}
    {region1}
    (vOption:Reg);
    {Line=1,0};
    {condition=(vOption="Reg")}
        {start_pos}{region}
    Reg/Serial:| [.16vReg!RegEvent_*]{sp=2}(RegFlag) Fragment ?
        {endregion}
    {endregion1};
    {condition=.t.}
    {region}
    <Go!Go><Close!Close>
    {sp=2}{text=%O={@@}%60,1.5:vSearchMsg};
    {endregion};
    {endregion2};
    %dlg%,<<%code%
    if a_dlg_button = "CLOSE" then
        ui_modeless_dlg_close("Query Selection")
    end if
    if left(a_dlg_button,9) = "RegEvent_" then
        if a_dlg_button = "RegEvent_change" then
            if RegFlag  = .t. then
                vFilter = "('"-vReg-"' $ Reg)"
            elseif RegFlag = .f. then
                vFilter = "(reg="-quote(rtrim(vReg))-".or.as="-quote(rtrim(vReg))-").or.('"-vReg-"' $ Old_id)"
            end if
            vOrder = "REG"
        end if
        a_dlg_button= ""
    end if
    if a_dlg_button = "Go" then
        if   rtrim(vFilter) = "" then
            vSearchMsg = "Invalid Filter"
        else
            vSearchMsg = "Filter is "-quote(vFilter)-" and Order is "-quote(vOrder)
        end if
    end if
    %code%)
    Last edited by Graham Wickens; 11-07-2019 at 12:17 PM.
    --
    Support your local Search and Rescue Unit, Get Lost!

    www.westrowops.co.uk

  2. #2
    "Certified" Alphaholic
    Real Name
    John Koh
    Join Date
    Jan 2004
    Location
    Maryland, USA
    Posts
    1,084

    Default Re: Poblem with a simple checkbox, what am I missing !!

    Hi

    This is what you want?


    ui_modeless_dlg_box("Query Selection",<<%dlg%
    {Background=#234+234+255}
    {removecomments}
    {font=Arial,9}
    {region1}
    (vOption:Reg);
    {Line=1,0};
    {condition=(vOption="Reg")}
    {start_pos}{region}
    Reg/Serial:| [.16vReg!RegEvent_*]{sp=2}(RegFlag!flagEvent) Fragment ?
    {endregion}
    {endregion1};
    {condition=.t.}
    {region}
    <Go!Go><Close!Close>
    {sp=2}{text=%O={@@}%60,1.5:vSearchMsg};
    {endregion};
    {endregion2};
    %dlg%,<<%code%
    if a_dlg_button = "CLOSE" then
    ui_modeless_dlg_close("Query Selection")
    end if
    if left(a_dlg_button,9) = "RegEvent_" then
    if a_dlg_button = "RegEvent_change" then
    When_changed_flag:
    'msgbox("test Am I here?")
    vSearchMsg="" 'clean
    if RegFlag = .t. then
    vFilter = "('"-vReg-"' $ Reg)"
    elseif RegFlag = .f. then
    vFilter = "(reg="-quote(rtrim(vReg))-".or.as="-quote(rtrim(vReg))-").or.('"-vReg-"' $ Old_id)"
    end if
    vOrder = "REG"
    end if
    a_dlg_button= ""
    end if
    If a_dlg_button ="flagEvent" then
    goto When_changed_flag
    a_dlg_button= ""
    end if

    if a_dlg_button = "Go" then
    if rtrim(vFilter) = "" then
    vSearchMsg = "Invalid Filter"
    else
    vSearchMsg = "Filter is "-quote(vFilter)-" and Order is "-quote(vOrder)
    end if
    end if
    %code%)

  3. #3
    Member Graham Wickens's Avatar
    Real Name
    Graham Wickens
    Join Date
    Apr 2000
    Location
    Gloucestershire, UK
    Posts
    795

    Default Re: Poblem with a simple checkbox, what am I missing !!

    thanks John,
    seems I had all the right elements at some point in my trial-and-error attempts.
    I now see that the checkbox has to be set before changing the vReg variable.
    --
    Support your local Search and Rescue Unit, Get Lost!

    www.westrowops.co.uk

Similar Threads

  1. Remove checkbox on grid with Checkbox Select Colunn
    By asawyer13 in forum Mobile & Browser Applications
    Replies: 4
    Last Post: 03-02-2019, 07:11 PM
  2. Simple genie or simple code to use a button to update an adjacent field in grid
    By clankford in forum Mobile & Browser Applications
    Replies: 25
    Last Post: 09-11-2015, 01:30 PM
  3. Clicking a checkbox wrongly affects display of other checkbox?
    By sdkrahn in forum Application Server Version 11 - Web/Browser Applications
    Replies: 1
    Last Post: 06-21-2012, 10:50 AM
  4. Dynamically populated checkbox - how to keep the label with its checkbox
    By Editor in forum Application Server Version 11 - Web/Browser Applications
    Replies: 4
    Last Post: 02-27-2012, 03:19 PM
  5. move simple grid data to a simple.txt file
    By Ken Tjia in forum Application Server Version 10 - Web/Browser Applications
    Replies: 3
    Last Post: 04-29-2011, 07:03 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •