This is sort of related to my earlier post.
I have form that launches a sub form via a button
The parent form has on it controls that make command buttons active/inactive based on the contents of a field
What I have found is that if the field contents are changed in the sub form, and then the sub form is closed, the controls on the command buttons aren't updated.
I am using the requery command in the On Close event procedure of the sub form to update the parent form data (which works fine)
However the command button controls are still in the state they were prior to opening the sub form.
Does anyone know how I "refresh" the parent form to reflect the new state of the form contents.
Many thanks in advance.
I have form that launches a sub form via a button
Code:
Private Sub Edit_AddBtn_Click()
On Error GoTo Err_Edit_AddBtn_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "New Customer Popup"
stLinkCriteria = "[CustomerID]=" & "'" & Me![CustomerID] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Edit_AddBtn_Click:
Exit Sub
Err_Edit_AddBtn_Click:
MsgBox Err.Description
Resume Exit_Edit_AddBtn_Click
End Sub
Code:
Private Sub Form_Current()
If IsNull(Me.EmailAddress) Or Me.EmailAddress = "" Then
Me.SendMail.Enabled = False
Else
Me.SendMail.Enabled = True
End If
End Sub
I am using the requery command in the On Close event procedure of the sub form to update the parent form data (which works fine)
Code:
Private Sub Form_Close()
Requery
End Sub
Does anyone know how I "refresh" the parent form to reflect the new state of the form contents.
Many thanks in advance.