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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calling a program for field validation

Status
Not open for further replies.

shenlon

Programmer
Jul 9, 2003
47
0
0
US
How can I set up my app so that when I enter a number into a specific field (a VIN check in this case) the app calls a program I have written to validate the VIN?
 
You can either put the code in the valid event of that control, or make a UDF out of the program using the valid event.
In your startup prg or the form's INit event, add this:
Code:
SET PROCEDURE TO MyPrg ADDITIVE
Then in the valid method:
Code:
IF MyProc(cVIN)
   RETURN 1
ELSE
   RETURN 0
ENDIF


-Dave Summers-
[cheers]
Even more Fox stuff at:
 
If the table is part of a database, you can also set field
level validation that calls on code in either a stored
procedure or an external program.

Darrell
 
As we find with so things fox, there are many ways to do it. Others include.

1. Make it seperate prg (not part of the Set procedure code) and execute it in the valid.

Do myprog.prg


2. Make it a method on your session object.
goApp.myMethod()

3. If the rules are solid, unlikely to change, you can create a seperate dll file and call the method in the dll.



Jim Osieczonek
Delta Business Group, LLC
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top