Requery Problem

CanWest

Registered User.
Local time
Today, 03:20
Joined
Sep 15, 2006
Messages
272
So I have read a lot on this subject and I seem to be getting nowhere. Here is the senario.

There are two forms and a subform invoved.
pfrm_AddClientNote has an embedded subform called sfrm_ClientBillableActivityFromCN. There is another popup form called pfrm_AddClientBillableActivityFromCN

Please excuse the long names but I need to know a forms purpose by it's name.

The user navigates to pfrm_AddClient ContactNote On that form there is a command button that opens pfrm_AddClientBillableActivityFromCN. A record is created in this form. The record source for this form and the subform on the underlying form are the same.

On the onclose event of pfrm_AddClientBillableActivityFromCN I have the following code

Code:
Private Sub Form_Close()

    Forms!pfrm_AddClientContactNote!Subject.SetFocus
    If Me.Dirty Then Me.Dirty = False
    Forms![pfrm_AddClientContactNote]![sfrm_ClientBillableActivityFromCN].Requery
    

End Sub

The requery does not seem to happen. However as a test i put a command button on pfrm_AddClientContactNote with this code.

Code:
Private Sub cmdReqerySubform

     If Me.Dirty Then Me.Dirty = False
     Forms![pfrm_AddClientContactNote]![sfrm_ClientBillableActivityFromCN].Requery

End Sub

This works. I am at a loss as to why the code that is on the onclose does dot work but the code that is on the command button does.
 
Last edited:

Users who are viewing this thread

Back
Top Bottom