S
shanesullaway
A2K
I am using the code below to filter a subform[subCusDet] on MainForm
[frmCustomers], (using a pop up form). If records are found I allow the
subform to be filtered and this part works fine. If no records are found I am
trying to set the FilterOn back to false. At this point I'm getting an error
that the filter failed and then the db locks up. Any thoughts as to why? I
use this same code on other forms, except that it's filtering the form it's
on and not using a pop up form, and it works fine.
Also, while I'm at it. I seem to recall reading that filtering is not real
reliable and can cause goofy problems. Is that true? Should I be doing this
using recordsets instead?
Below is my code. Thanks for any help you can provide,
Shane
Dim stFilter As String
stFilter = "CreatedBy='" & Me.cboEnteredBy.Column(1) & "'"
Forms![frmCustomers]![subCusDet].Form.Filter = stFilter
Forms![frmCustomers]![subCusDet].Form.FilterOn = True
Forms![frmCustomers]![subCusDet].Form.Refresh
Dim stRCount As String
stRCount = Forms![frmCustomers]![subCusDet].Form.RecordsetClone.RecordCount
If stRCount <= 0 Then
Eval ("Msgbox('NO MATCHING PROGRESS NOTES!@The filter you chose did not
produce a match!. " & _
"The Progress Notes List will be reset Showing All Progress Notes@@',0,'Amigo
Message System')")
Forms![frmCustomers]![subCusDet].Form.FilterOn = False
Forms![frmCustomers]![subCusDet].Form.Requery
End If
I am using the code below to filter a subform[subCusDet] on MainForm
[frmCustomers], (using a pop up form). If records are found I allow the
subform to be filtered and this part works fine. If no records are found I am
trying to set the FilterOn back to false. At this point I'm getting an error
that the filter failed and then the db locks up. Any thoughts as to why? I
use this same code on other forms, except that it's filtering the form it's
on and not using a pop up form, and it works fine.
Also, while I'm at it. I seem to recall reading that filtering is not real
reliable and can cause goofy problems. Is that true? Should I be doing this
using recordsets instead?
Below is my code. Thanks for any help you can provide,
Shane
Dim stFilter As String
stFilter = "CreatedBy='" & Me.cboEnteredBy.Column(1) & "'"
Forms![frmCustomers]![subCusDet].Form.Filter = stFilter
Forms![frmCustomers]![subCusDet].Form.FilterOn = True
Forms![frmCustomers]![subCusDet].Form.Refresh
Dim stRCount As String
stRCount = Forms![frmCustomers]![subCusDet].Form.RecordsetClone.RecordCount
If stRCount <= 0 Then
Eval ("Msgbox('NO MATCHING PROGRESS NOTES!@The filter you chose did not
produce a match!. " & _
"The Progress Notes List will be reset Showing All Progress Notes@@',0,'Amigo
Message System')")
Forms![frmCustomers]![subCusDet].Form.FilterOn = False
Forms![frmCustomers]![subCusDet].Form.Requery
End If