>I have this pageframe from which has seven pages to it. One each of these pages is on grid filled with different ranges of data. Some grids have 14 fields while others have only one. When everything is all filled out and all is said and done, the end user is going to head to the last page and find a submittal button. When this button is click, I want to have a method that has Foxpro verify that all fields have been inputed with data (i.e. no blank fields). The source of all the grids are cursors. Any suggestions would be very helpful!! Thank you!!
You don't need to go to the grids for this - go to the cursors, instead.
I recommend checking all required fields and then giving an error message/report, rather than stopping at the first empty required field. e.g., let's say you have 2 cursors, Company and Employee. Company name is required, Employee first name and last name are required. Company would have one record, Employee would have multiple.
Local lcErrorMsg, llRetVal
lcErrorMsg = ""
Select company
If Empty(cname)
lcErrorMsg = lcErrorMsg + Chr(13) + "Company Name is required."
EndIf
Select people
Locate For Empty(clastname) Or Empty(cfirstname)
If Found()
lcErrorMsg = lcErrorMsg + Chr(13) + "Employee First and Last Name are required."
EndIf
If !Empty(lcErrorMsg)
lcErrorMsg = Substr(lcErrorMsg,2) && trim off first Chr(13)
MessageBox(lcErrorMsg, 48, "Application")
llRetVal = .F.
Else
llRetVal = .T.
EndIf
Return llRetVal
Insanity: Doing the same thing over and over and expecting different results.