Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Valid event for grid objects.
Message
From
09/03/1998 21:18:08
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00083519
Message ID:
00083532
Views:
21
>Textbox validation code within a grid doesn't work when you click on an object outside the grid.
>
>In my textbox.Valid event with the grid I validate the contents of the textbox. If the value is invalid I display a message and return 0 else I return 1.
>
>If I enter an invalid value in the textbox then click on a different column in the grid my error message is displayed and the focus does not change. If I enter the same value then click on a field outside the grid, I get my error message but the focus changes to the field that I clicked on. The return 0 doesn't stop the focus from changing.
>
>Any ideas?

This idea will work but I'm not sure you want to use it.

(1) Add a property to the form r_moveok
(2) In the valid of the grid text, display the message and set this property to .F. if invalid data. Else set this property to .T.
(3) In the getfocus of the other objects on the screen use the following code:
if thisform.r_moveok = .F.
thisform.grid1.setfocus
return .f.
endif

This is a little hokey but it might give you somewhere to start.

Robert
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform