T
tuesamlarry
I have a main form with a text box in Form Header which AfterUpdate finds the
record and displays the main form with correct record and all its subforms
for editing and adding. When I first open the main form there is data showing
so I assume the form has pulled all records from the back-end and is now
waiting for me to filter it. I would like to reduce network traffic but don't
know where and how to turn FilterOn on and off. I have placed
Me.Filter = "(False)"
Me.FilterOn = True
in the form's OnOpen event.
In the form header text box which I enter the record ID I want, i placed
Me.Filter = Me.utbFindClientID
Me.FilterOn = True
in the AfterUpdate event.
When I open the form and enter a valid ID, I get error 3420 Object invalid
or no longer set.
I would like some advice on where/how to filter form so as not to pull more
data than necessary over the network in a multi-user situation using a FE and
BE.
Here is the code that the Form's header text box uses
Dim rs As DAO.Recordset
If Not IsNull(Me.utbFindClientID) Then
If Me.Dirty Then
Me.Dirty = False
End If
Set rs = Me.RecordsetClone
rs.FindFirst "[clntClientID] = """ & Me.utbFindClientID & """"
Me.Filter = Me.utbFindClientID
Me.FilterOn = True
If rs.NoMatch Then
Call MsgBox("Client ID Does Not Exist" _
& vbCrLf & "Check the numbers and try again" _
, vbQuestion, Application.Name)
Else
Me.Bookmark = rs.Bookmark
Select Case MsgBox("Is this the Client you want?" _
& vbCrLf & "Check the Family names
below." _
& vbCrLf & "Press Yes to open this file." _
& vbCrLf & "Press No to enter a new
Client ID" _
, vbYesNo Or vbQuestion Or
vbDefaultButton1, "Client File")
Case vbYes
Me.pageServicesProvided.SetFocus
Me.sfrmServiceProvided.SetFocus
DoCmd.GoToRecord , , acNewRec
Case vbNo
DoCmd.GoToControl ("utbFindClientID")
End Select
End If
Set rs = Nothing
End If
Thank you for your advice in advance.
record and displays the main form with correct record and all its subforms
for editing and adding. When I first open the main form there is data showing
so I assume the form has pulled all records from the back-end and is now
waiting for me to filter it. I would like to reduce network traffic but don't
know where and how to turn FilterOn on and off. I have placed
Me.Filter = "(False)"
Me.FilterOn = True
in the form's OnOpen event.
In the form header text box which I enter the record ID I want, i placed
Me.Filter = Me.utbFindClientID
Me.FilterOn = True
in the AfterUpdate event.
When I open the form and enter a valid ID, I get error 3420 Object invalid
or no longer set.
I would like some advice on where/how to filter form so as not to pull more
data than necessary over the network in a multi-user situation using a FE and
BE.
Here is the code that the Form's header text box uses
Dim rs As DAO.Recordset
If Not IsNull(Me.utbFindClientID) Then
If Me.Dirty Then
Me.Dirty = False
End If
Set rs = Me.RecordsetClone
rs.FindFirst "[clntClientID] = """ & Me.utbFindClientID & """"
Me.Filter = Me.utbFindClientID
Me.FilterOn = True
If rs.NoMatch Then
Call MsgBox("Client ID Does Not Exist" _
& vbCrLf & "Check the numbers and try again" _
, vbQuestion, Application.Name)
Else
Me.Bookmark = rs.Bookmark
Select Case MsgBox("Is this the Client you want?" _
& vbCrLf & "Check the Family names
below." _
& vbCrLf & "Press Yes to open this file." _
& vbCrLf & "Press No to enter a new
Client ID" _
, vbYesNo Or vbQuestion Or
vbDefaultButton1, "Client File")
Case vbYes
Me.pageServicesProvided.SetFocus
Me.sfrmServiceProvided.SetFocus
DoCmd.GoToRecord , , acNewRec
Case vbNo
DoCmd.GoToControl ("utbFindClientID")
End Select
End If
Set rs = Nothing
End If
Thank you for your advice in advance.