R
RW
I have a combo box in a main form. On afterupdate, I need to compare the
selection with data in a field on the subform and then populate another field
on the subform with a result.
I have tried, I think, all iterations for
if forms!mainform!controlname = Forms!mainform.subform!controlname then
Forms!mainforn.subform!controlname = "OK"
Else
Forms!mainforn.subform!controlname = "Problem"
End If
I've even tried to setfocus on the subform before trying to populate the
subform controlname field. What am I doing wrong? If I write the code in an
afterupdate of the subform to compare to a field in the main form, I can
populate the difference field in the subform without any problems - but I
need to compare the fields from the main form.
Any help is appreciated.
selection with data in a field on the subform and then populate another field
on the subform with a result.
I have tried, I think, all iterations for
if forms!mainform!controlname = Forms!mainform.subform!controlname then
Forms!mainforn.subform!controlname = "OK"
Else
Forms!mainforn.subform!controlname = "Problem"
End If
I've even tried to setfocus on the subform before trying to populate the
subform controlname field. What am I doing wrong? If I write the code in an
afterupdate of the subform to compare to a field in the main form, I can
populate the difference field in the subform without any problems - but I
need to compare the fields from the main form.
Any help is appreciated.