G
Guest
I have a main form and sub form and need to find records in both
I have the following code:
open form
' Form_Open
'
'------------------------------------------------------------
Private Sub Form_Open(Cancel As Integer)
On Error GoTo Form_Open_Err
Me.RecordSource = "service request"
DoCmd.Maximize
DoCmd.ApplyFilter ("Query2")
Form_Open_Exit:
Exit Sub
Form_Open_Err:
MsgBox Error$
Resume Form_Open_Exit
click button:
Private Sub Command105_Click()
On Error GoTo Last_Err_command105_Click
Me.RecordSource = "Query1"
DoCmd.Requery
Me.Command105.SetFocus
SendKeys "%HA", False
RunCommand acCmdFind
GoTo Exit_Command105_Click
Exit_Command105_Click:
Exit Sub
Last_Err_command105_Click:
MsgBox Err.Description
Resume Exit_Command105_Click
End Sub
The Query1 allows a search of all data in the main form and sub form.
I need to set rhe record source back to Me.RecordSource = "service request"
to remove duplicate recorde in the query when the find/replace is closed
I know rhis an't pretty. but it works. But i need to know how to "reset
the" the record source when the find/replace box is close.
Any help would maybe keep me employed
thanks
andyc
I have the following code:
open form
' Form_Open
'
'------------------------------------------------------------
Private Sub Form_Open(Cancel As Integer)
On Error GoTo Form_Open_Err
Me.RecordSource = "service request"
DoCmd.Maximize
DoCmd.ApplyFilter ("Query2")
Form_Open_Exit:
Exit Sub
Form_Open_Err:
MsgBox Error$
Resume Form_Open_Exit
click button:
Private Sub Command105_Click()
On Error GoTo Last_Err_command105_Click
Me.RecordSource = "Query1"
DoCmd.Requery
Me.Command105.SetFocus
SendKeys "%HA", False
RunCommand acCmdFind
GoTo Exit_Command105_Click
Exit_Command105_Click:
Exit Sub
Last_Err_command105_Click:
MsgBox Err.Description
Resume Exit_Command105_Click
End Sub
The Query1 allows a search of all data in the main form and sub form.
I need to set rhe record source back to Me.RecordSource = "service request"
to remove duplicate recorde in the query when the find/replace is closed
I know rhis an't pretty. but it works. But i need to know how to "reset
the" the record source when the find/replace box is close.
Any help would maybe keep me employed
thanks
andyc