I get a yellow highlight over...
If Not Current.Project.AllForms("frm_ActiveTasks").IsLoaded Then
By the way on the On Click of the exit button I had some other code to make
sure that the required fields were entered and then I added your code
altogether it looks like this...
Private Sub CloseAndSaveData_Click()
If Me.Dirty Then
Me.Dirty = False
End If
DoCmd.Close acForm, Me.Name
Dim frm_theOtherForm As Form
' make sure the other form is open
If Not Current.Project.AllForms("frm_ActiveTasks").IsLoaded Then
DoCmd.OpenForm "frm_ActiveTasks"
End If
Set ftm_theOtherForm = Forms![frm_ActiveTasks].Form
frm_theOtherForm.Requery
Set frm_theOtherForm = Nothing
End Sub
Iram/mcp
NKTower said:
Dim frm_theOtherForm As Form
' make sure the other form is open
If Not Current.Project.AllForms("frm_ActiveTasks").IsLoaded Then
DoCmd.OpenForm "frm_ActiveTasks"
End If
SET ftm_theOtherForm = Forms![frm_ActiveTasks].Form
frm_theOtherForm.Requery
SET frm_theOtherForm = Nothing
:
Since I am not too familiar with how to add my other forms name to your code,
can you help he put it in your code? The other forms name is frm_ActiveTasks
This is the name of the form that needs to be requeried. And yes I do plan
on putting your code on the On Click of the exit button on the data entry
form.
Thanks.
Iram
:
in an appropriate location, such as the data entry form's OnClose event, try
this...
Dim frm_theOtherForm As Form
' make sure the other form is open
If Not Current.Project.AllForms("theOtherForm").IsLoaded Then
DoCmd.OpenForm "theOtherForm"
End If
SET ftm_theOtherForm = Forms![theOtherForm].Form
frm_theOtherForm.Requery
SET frm_theOtherForm = Nothing
:
I have a "data entry" form and when i am done adding a new record I want to
click on a close button that not only closes the form but also refreshes
another form that is open.
I know of the "Me.Requery" but that only requeries the form that you are on.
I need to refresh a different form.
Can you help me with the correct vba for this?
Iram/mcp