Hi John:
>I am calling a frmmodaldatachild. On the form there are two combo's and lrequired = .t.for both. But the form will still allow me to leave each of the combo boxes blank. Does anyone have any ideas?
This is a problem that I have referred to Dave in the past but he doesn't see it as a problem. In his view, if data has not been changed, it shouldn't be validated. If it doesn't get validated, the code that checks for the required field(s) is not processed. Therefore, if you load a modal data child and dont change anything but the controls are "required", this process is bypassed. There are numerous solutions to this problem that all involve subclassing. However, you could try something like the following that involves subclassing the form's Save method :-
Function frmModalDataChild.Save
LParameters cWorkAreaList
If Not Thisform.lChanged
If Not This.ValidateForm(m.cWorkareaList)
Return .F.
Endif
Endif
Return Dodefault(m.cWorkAreaList)
Personally, I think there should be a framework originated form property that can be set True so that even when there are no data changes, the framework checks to enforce "required" field.
HTH
Best
-=Gary