I have a parent form (Accounts) that contains some customer information such as Account No, Last Name, and Phone Number. I have a textbox and command button setup to search the account information for a particular string. The command button has the following in the OnClick:
Private Sub Command61_Click()
On Error GoTo Err_Command61_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Accounts"
stLinkCriteria = "[PhoneNo] LIKE " & "'*" & [Text51] & "*'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
.OrderByOn = True
.OrderBy = "PhoneNo"
Since both the search box and the actual account information being searched reside on the parent form, everything works great. On another tab of the parent form, I have a subform (frmClassifieds) that contains ads for each of the customers. The accounts and classifieds are related so when you switch the account, the subform display any and all ads for that particular customer. My question is this... How do I go about creating a textbox/command button search (as in the code example above) that will allow me to search for a particular ad in the subform and update the Account info on the parent form at the same time? In other words:
On the parent form, enter Ad number into text box and click command button. The subform refreshes to show the particular ad and on the parent form, you are shown the account information of the customer that the ad belongs to. I hope this is clear. If anyone has a suggestion, I'm open to it. Thanks.