Form will not requery (using pass through query)

rudeboymcc

Registered User.
Local time
Today, 14:38
Joined
Sep 9, 2008
Messages
69
Hi. I have two forms, RM and DS, which are nearly identical (DS started as a copy of RM). They are both based on their own pass through query (which is not complex, just "EXEC dbo.sp_RM" and "EXEC dbo.sp_DS".

The recordsource of both forms is set to their pass through query.

Yet with RM, when i press F5 or shift+F9, the form refreshes and requeries (i.e. the changes I just made on a form now show).

with DS however, neither me.requery or me.refresh do anything.

Both forms are set to snapshot, all other form properties are the same.

What could be causing this form to not try to rerun the underlying query?
 
Ok slightly more info: The refresh works fine when the form loads. it's only when I open a record's details (seperate pop-up form) and close it that the DS's refresh doesn't work. THe code I use to open the details form is:

Code:
Public Sub OpenForm(frmName As Form, Form As String, WhereFilter As String, ID As Integer, Optional Args As String)
    Dim OldFilter As String
    
    'Save the old filter to apply it again
    If frmName.FilterOn = True Then
        OldFilter = frmName.Filter
    End If
    
    'Open the Form required
    DoCmd.OpenForm Form, , , WhereFilter & ID, acFormEdit, acDialog, Nz(Args, "")
    
    frmName.Requery
    
    'Apply Old Filter
    If IsNull(OldFilter) Then
    Else
        frmName.Filter = OldFilter
        frmName.FilterOn = True
    End If
     
    'Jump to Old Record
    DoCmd.SearchForRecord acDataForm, frmName.Name, acFirst, "[ID] = " & ID
    
End Sub

This si the code that all my other forms use and they work fine. As soon as the popup form is closed, the form that called the function is requereied.

What reason would requery disable for?
 

Users who are viewing this thread

Back
Top Bottom