Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Grid Control and checkboxes 2

Status
Not open for further replies.

Gameboy9

Programmer
Joined
Jun 8, 2001
Messages
39
Location
US
So I have a column full of checkboxes, and a label right over that column that keeps track of the number of boxes that are checked.

When I click on a checkbox, I have a label over it that should increase by one immediatly after I turn a box on, and decrease by one immediatly after I turn a box off.

Instead, the value sometimes updates correctly, and sometimes doesn't until the next click. This was attempted using the click, lostfocus, and interactivechange events. What should I be trying in order to get the results I'd like?

Thanks again!
 
Gameboy,

Did you keep the check boxes in a group?

Foxbldr
 
Foxbldr,

I'm not sure of what you're talking about...

But I can tell you that I have a grid, underneath that I have this column, and underneath that I have a check1 control. Might also be the column that also has a text1 control, but that's hidden. (I'd like to get rid of that completly, though.)
 
I'm not sure what happen, but do you refresh the FORM ? Maybe it helps

To get rid of text1 control:
- right click on the grid, choose edit
- on the properties window, click the combo box
- select text1 control you want to remove
- click on the form titlebar, press DELETE key

Regards

-- AirCon --
 
What AirCon suggests seems very viable: REFRESH the form during your click or interactivechange event.
Alternately:
1) this.parent(.parent).SoAndSo.caption.refresh()

or

2)
Count to ncount FOR CheckboxField = 1 (or .T.)
SuchandSuchanumberCount = ncount
this.parent(.parent).SoAndSo.CAPTION=allt(str(SuchandSuchanumberCount))

Hope this helps,
Philip
 
Got it. But had to do this instead:

SELECT *whatever*
lnCurrentRecord = RECNO(*whatever*)
CALCULATE SUM(*whatever*), sum(*whatever*), cnt() FOR *whatever* = .t. to ln*whatever*, ln*whatever*, ln*whatever*
GOTO lnCurrentRecord

Philip's answer was most helpful, to that question, but AirCon helped getting rid of that control I wasn't using... thanks to both. :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top