
Originally Posted by
slave138
Now that I understand better, you should put the following in the LostFocus event for each text field:
Code:
Me.sfmFriendship.Form.FriendOf.Requery
Thank you. I couldn't get that to work (could you?) but I have found success with something I've based on it:
Private Sub FirstName_LostFocus()
On Error GoTo Err_FirstName_LostFocus
Me!sfmFriendship.Form.Refresh
Exit_FirstName_LostFocus:
Exit Sub
Err_FirstName_LostFocus:
MsgBox Err.Description
Resume Exit_FirstName_LostFocus
End Sub
Setting aside the fact that this seems to work, can you see any problem with it?
One final question. I've put this in the LostFocus event of the Hobby field in frmHobby, which links to the sfmPersonHobby (the second subform) within frmPerson:
Private Sub Hobby_LostFocus()
On Error GoTo Err_Hobby_LostFocus
Forms!frmPerson.sfmPersonHobby.Form.Refresh
Exit_Hobby_LostFocus:
Exit Sub
Err_Hobby_LostFocus:
MsgBox Err.Description
Resume Exit_Hobby_LostFocus
End Sub
It works fine when frmPerson is open but generates a 'can't find form' error message when frmPerson is closed. How would I add a condition to say 'Refresh sfmPersonHobby if frmPerson is open; otherwise forget about it'?