Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Stored Procedures and Private Datasessions
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00148402
Message ID:
00148766
Views:
36
>>>Check your buffer mode. I think the default buffer mode won't fire the update trigger until you close the table or move off the current record. If your using buffering there may be something else preventing the update trigger from firing depending on the circumstances.
>>
>>I think I have tried all the possibilities and none seems to work as I expect it. Could you guide me?
>>
>>Pat

Pat,
After looking at several things I found that by using a subclass of the wizstyle navigation toolbar, the update trigger would fire when using a form with a private data session. I was a little puzzeled because I tested a form with my own quickie add and save buttons. The update didn't fire because I wasn't moving the pointer in buffermode 0, which will not fire the update trigger. So, I tested this by creating a dummy table in an idle project by doing this:
Make a test project and create a database called testdb, create a table in testdb called test, create a stored procedure like so:
proc print_message
acti scre
? "Trigger fired..."
endproc
In the update trigger of the table put print_message(), then go to the command window and issue:
open database testdb
use test
edit
Then edit that field and hit return or tab, the Trigger fired message should print to screen. In the case of a form, the record pointer does not necessarily move when you reach the character width or return or tab.
I able to get the trigger to fire by putting the following in my add button:
append blank
thisform.refresh()
thisform.txtedit.SetFocus()
Then when I edited the field the trigger fired. (BTY, I think if the table belongs to a database, the database should be opened when the form is opened.) You may want to consider subclassing the wizstyle navigation bar. I have used it exclusively with my own pics and code modifications to fit what we do here and it works pretty well. It does alot of work for you like checking for any buffermode, reviews the dataenv, etc. Once I understood how to modify it with wreaking havoc on other instances it has become very handy. For example, I am working on a maintenence setup form that has 20 tables in the DE, each displayed on a different page/pageframe. All I have to do is put in the click event of each page, select thisalias, thisform.nav_toolbar.Initvars, thisform.refresh(), the Initvars method of the navbar sets everything to the newly selected table without alot of headache. It behaves like VPM's formtoolbar class.
There are several other methods built in that save me alot of headache. I think everyone needs less headache when developing in VFP.;)
Hope you can build on some of this dribble...

Eric Kleeman
Developing VFP in Thailand
Previous
Reply
Map
View

Click here to load this message in the networking platform