Requery not working

speakers_86

Registered User.
Local time
Today, 05:21
Joined
May 17, 2007
Messages
1,919
I hate to post this. Ive fixed this problem many times already, but I cant seem to get this working. Since I am getting better in access, Ive been trying not to put stupid questions here. :(

Code:
Private Sub Form_Close()
If IsfrmworkordersaccountsreceivableOpen("frmworkordersaccountsreceivable") = True Then
Me.Refresh
[Forms]![frmworkordersaccountsreceivable]![subNotes].Form.Requery
End If

End Sub


The is open check works in other similar instances of code. So that shouldnt be the problem. On close, nothing happens. No requery, no error.
 
first put a breakpoint on your IF line and see if it actually is finding that argument as true. If it never does then it will not do anything. I suspect that line is not ever returning true. But if it does then we can go to the next part.
 
I had to look breakpoints up so ill tell you how I did it. I added a breakpoint to the is open line, then ran the code by closing the form. When the code came up, I held my mouse over the criteria true and it said True=True.

I forgot to say the is open check is run by a public module.

I can also tell it is working because when I close the form without having the form frmworkorder..., there is no error, which means the code recognizes that my work order form is not open, and it does not try to requery the subform.
 
Next thing up is

Are you sure that your subform CONTAINER (the control that houses the subform on the main form) is actually named subNotes?
 
The name of the control is "subnotes".
The name of the subform is "subworkordersnotes".
 
Its 2007. Ive tried to convert it before, but Im using new features and Ive never been able to convert to an older one.
 
I found the problem. The module I have contains the is open check for frmworkorders..., then there is another check for another form. I got rid of that and it works. I guess Ill have to have a seperate module for each little check! Thanks for being so ready to help though!
 

Users who are viewing this thread

Back
Top Bottom