G
Guest
I have a main form with two sub-forms.
On subform 2, I wish to add a control that will open a search box and locate
a record that matches what the user types in the search box.
I modified some code that I found, and it works fine. However, it opens the
sub form 2 a second time. I would like to simply display the record in the
currently open sub form. In other words, have it "act" like a regular
search. I am not using a regular search, as I wish users to be able to
easily search for a particular field content without any knowledge of Access.
Private Sub Command26_Click()
On Error GoTo Err_Command26_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frm_ppt_search"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Command26_Click:
Exit Sub
Err_Command26_Click:
MsgBox Err.Description
Resume Exit_Command26_Click
End Sub
On subform 2, I wish to add a control that will open a search box and locate
a record that matches what the user types in the search box.
I modified some code that I found, and it works fine. However, it opens the
sub form 2 a second time. I would like to simply display the record in the
currently open sub form. In other words, have it "act" like a regular
search. I am not using a regular search, as I wish users to be able to
easily search for a particular field content without any knowledge of Access.
Private Sub Command26_Click()
On Error GoTo Err_Command26_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frm_ppt_search"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Command26_Click:
Exit Sub
Err_Command26_Click:
MsgBox Err.Description
Resume Exit_Command26_Click
End Sub