You can try the: Refresh command after your calculation and writing to the field. This saves the data and you may not even need to requery the subform. If you're doing this on a new record, you want to make sure any required fields are first filled in before issuing a Refresh command. (Note: Refresh only works on the form you're currently editing. You cannot do this: Forms!MyMainform!MySubform.Refresh. If you're calculation coding is 'outside' the subform, you'll either have to put that calculation as a function within the subform so you can utilize the Refresh command, or you'll need to find a way to get the focus back to the subform and issue a Refresh command (ie. calling a Public Function within the subform which has the Refresh command).
To set the focus to the field on the subform: Forms!MyMainFormName!MySubformName!MyFieldName.set focus (remember: you can't set the focus to the control if it already has the focus - ie. You must set the focus to another control and then to the control you want to.)
If the above doesn't work, try first setting the focus to the mainform (or subform), then the control:
Sometimes MSAccess get's stubborn and you must set the focus to the form/subform first. Of course, you need to make sure the field CAN actually get the focus (ie. it's Enabled property = True).
To write a value to the field on the subform: Forms!MyMainFormName!MySubformName!MyFieldName = Forms!SomeOtherForm!SomeOtherSubform!OtherFieldNam e
Last edited by pkstormy; 03-27-10 at 02:32.
Expert Database Programming
MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)