Searching in Subforms

  • Thread starter Thread starter tcrow555
  • Start date Start date
T

tcrow555

Guest
Hello, I have put together a simple database where I have two tables. One containing customer account number, and name, etc. The subform contains the Order number and details about the order. I want to perform a search on both forms, but cannot seem to perform searches on the subform. My co-workers inform me that this isn't possible. I don't believe it.

Can someone provide me with help to do this?
 
There are several ways to do the search. You can try FindRecord method as showed below. Just set Focus to your subform and do the Find.

Code:
Me.YourSubFormControlNameHere.SetFocus
DoCmd.FindRecord "abc", acAnywhere, False, acSearchAll, False, acAll
 
FindRecord Method?

:confused:

Wow I looked at your suggestion and I am totally lost. Can you possibly provide me with more help. I could upload you the database if you would like... I really appreciate your assistance and help.

Thanks!
 
Follow-up

Tim, I wanted to see if you would take a look at the DB itself and help me figure out what is going wrong. When I use the button to perform a search, it finds the record, but it also updates the record to the current record in the main form.

I really only want to perform a search function on the subform.

I attempted to upload the db, but it is too large. Do you have a email address that you wouldn't mind for me to send the file for you to glance at?

Please email me at rmorgan@ccwave.net

Thanks!
 
I guess you use a bound text box as the input text box for keying the string you want to search.

I checked you db and I found it's One-To-One relationship. Then I guess what you want is to search the data in the subform and if there is any, move the main form to the record related to the linked record found in the subform? Is that true?

The sample db is for One-To-Many relationship.
 

Users who are viewing this thread

Back
Top Bottom