moving from a record

The place for peer-to-peer support for Visual ProMatrix versions older than VPME 9.1.

moving from a record

Postby jporrata » Wed May 27, 2015 8:42 am

Hi,

Is there any property or method that I can use to check if the user is moving or exiting from a record in a form_toolbar and prevent it from doing it? Am using the Queryunload, first, last, prior and next but I realized that they could do a find or list to exit without checking for the condition I have.

What would be the best approach to do this? Prevent the user to leave a record if a condition is not met.

Thanks
Javier
jporrata
 
Posts: 85
Joined: Mon Aug 16, 2010 3:55 pm

Re: moving from a record

Postby Bob » Wed May 27, 2015 2:09 pm

The form's navigation methods all start by calling the form's writebuffer() method so looks like a place to start.

Uses the same DECLAREs eie FILE_CANCEL
Bob
 
Posts: 718
Joined: Mon Jun 14, 2010 6:53 am
Location: Near Albany, NY

Re: moving from a record

Postby jporrata » Thu May 28, 2015 8:00 am

Thanks Bob. I think that is the place.

How can I know that is the first time the form loads? How would you do that? Like if I have the find form loading at start, I don't want the condition to fire until I do the first search or the first move off the record.

Thanks
jporrata
 
Posts: 85
Joined: Mon Aug 16, 2010 3:55 pm

Re: moving from a record

Postby Bob » Thu May 28, 2015 8:46 am

VPM itself does something like that with the lFirst property. Defaults to .t., but set to .f. in the activate method to only allow adding the form's name to the Windows menu once.

I would do something similar with a custom form property.
Bob
 
Posts: 718
Joined: Mon Jun 14, 2010 6:53 am
Location: Near Albany, NY

Re: moving from a record

Postby jporrata » Wed Jun 03, 2015 1:22 am

Thanks Bob. I create a property and checking it from the writebuffer event I was able to acomplish what I want.

Thanks
jporrata
 
Posts: 85
Joined: Mon Aug 16, 2010 3:55 pm


Return to VPM - older versions

Who is online

Users browsing this forum: No registered users and 1 guest

cron