dbTalk Databases Forums  

Checkboxes and a process question

comp.databases.paradox comp.databases.paradox


Discuss Checkboxes and a process question in the comp.databases.paradox forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Rey
 
Posts: n/a

Default Checkboxes and a process question - 02-23-2006 , 06:23 PM






Howdy all.

Have a form where I have a tableframe in which I've changed the display of
the purge field (A,1) to a checkbox obj. I tried the code below in the
changevalue event but it does not update the underlying table nor Assncount
field until you move off the current checkbox. Researching came up with info
on the dbCommunity site (ObjectPALŽ List Tricks Kasey Chang). on using
editCommitField. However, this didn't work for me...maybe missing something
my four eyes aren't seeing 8-)

So how can I get it to save/commit the last clicked checkbox action?

Process question:
Have a form that purges inactive/old transaction records. One method "backs
up" the production tbls involved prior to deleting the transactions using
xcopy tablename.* (faster than Pdox table copy).

Rather than cause this event to run every time, was wondering if it might
not be better to set a flag or check the table creation datetime such that
if it is several hrs old then backup the tables. Or I could just add the
current datetime to the tables and have an incremental backup though then
later I have to delete the backups at some time...

Thanks in advance,
Rey

**********************

checkbox's checkedvalue = "P"
uncheckedvalue = ""
*********************************
if self.value = "P" THEN
;self.value = blank()
dodefault

IF NOT (NumSelected = 0) THEN
NumSelected = NumSelected - 1
Assncount = NumSelected
EndIF

ELSE
;self.value = "P"
dodefault

NumSelected = NumSelected + 1
Assncount = NumSelected
EndIF





Reply With Quote
  #2  
Old   
Anders Jonsson
 
Posts: n/a

Default Re: Checkboxes and a process question - 02-24-2006 , 12:22 AM






Rey,

When you have two questions it's often better to put them into two seperate
threads.

1) Regarding the checkbox code. The code you have showed will not fire until
the changevalue method triggers and that will not happen unless you move of
the checkbox OR you issue a EditCommitField. You could do the later in the
newValue event. Did you try that?

I find your change value code somewhat confusing, shouldn't you start with a
doDefault and then reverse the two code sections?

2) If you use xcopy, make sure that no one is using the tables as xcopy
might fail (totally, or even worse, partially) if files are locked.

Anders




"Rey" <reycollazo (AT) cox (DOT) net> skrev i meddelandet
newsgsLf.32626$V27.8116 (AT) fed1read06 (DOT) ..
Quote:
Howdy all.

Have a form where I have a tableframe in which I've changed the display of
the purge field (A,1) to a checkbox obj. I tried the code below in the
changevalue event but it does not update the underlying table nor
Assncount field until you move off the current checkbox. Researching came
up with info on the dbCommunity site (ObjectPALŽ List Tricks Kasey Chang).
on using editCommitField. However, this didn't work for me...maybe missing
something my four eyes aren't seeing 8-)

So how can I get it to save/commit the last clicked checkbox action?

Process question:
Have a form that purges inactive/old transaction records. One method
"backs up" the production tbls involved prior to deleting the transactions
using xcopy tablename.* (faster than Pdox table copy).

Rather than cause this event to run every time, was wondering if it might
not be better to set a flag or check the table creation datetime such that
if it is several hrs old then backup the tables. Or I could just add the
current datetime to the tables and have an incremental backup though then
later I have to delete the backups at some time...

Thanks in advance,
Rey

**********************

checkbox's checkedvalue = "P"
uncheckedvalue = ""
*********************************
if self.value = "P" THEN
;self.value = blank()
dodefault

IF NOT (NumSelected = 0) THEN
NumSelected = NumSelected - 1
Assncount = NumSelected
EndIF

ELSE
;self.value = "P"
dodefault

NumSelected = NumSelected + 1
Assncount = NumSelected
EndIF







Reply With Quote
  #3  
Old   
Rey
 
Posts: n/a

Default Re: Checkboxes and a process question - 02-24-2006 , 12:35 PM



Howdy Anders.
Thanks for reply and suggestion on separating questions.

Tried the new value event on the prev form w/no success. Then this AM, ran
another test form using a copy of the orig table but changing the Purge
field to logical. Used following code in newvalue event and still was unable
to get last click committed:

dodefault
if eventinfo.reason() = EditValue then
self.action(editCommitField)
endif

Any thoughts?

Thanks,
Rey



Reply With Quote
  #4  
Old   
Bertil Isberg
 
Posts: n/a

Default Re: Checkboxes and a process question - 02-24-2006 , 01:56 PM



Rey
<<
Used following code in newvalue event and still was unable
to get last click committed:
Quote:
In changeValue(), the new value is not available as self'value until after
doDefault. Before doDefault, the new value is found in eventInfo.newValue()


--
Bertil Isberg - CTECH
Paradox buglist:
online: http://web.comhem.se/~u82608896/

"Rey" <reycollazo (AT) cox (DOT) net> skrev i meddelandet
news:agILf.34444$V27.5978 (AT) fed1read06 (DOT) ..
Quote:
Howdy Anders.
Thanks for reply and suggestion on separating questions.

Tried the new value event on the prev form w/no success. Then this AM, ran
another test form using a copy of the orig table but changing the Purge
field to logical. Used following code in newvalue event and still was
unable
to get last click committed:

dodefault
if eventinfo.reason() = EditValue then
self.action(editCommitField)
endif

Any thoughts?

Thanks,
Rey





Reply With Quote
  #5  
Old   
Rey
 
Posts: n/a

Default Re: Checkboxes and a process question - 02-24-2006 , 02:04 PM



Found a solution after a little more research on google:
Added action(fieldForward) after editCommitField which triggers changeValue
event.
Then in the changeValue event, added or subtracted from the vars as the vars
were not being updated/changed w/i the newvalue event.

Thanks



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.