Searches in SubForm

P

Pearl

First, I don't know programming nor do I use SQL commands. I have some
familiarity with Access database designs so far as there are available tools
inside of it.

I have a database where I have a Master Form and inside it are subforms. My
problem is that I need to conduct search/find on any of the fields contained
in the Master form and the subforms. I can do searches and Finds in the
fields directly included in the master form but not within the subform
fields. How can i do this?
 
S

Steve

You do the search in the subform the same as you do a search in the main
form. When you do the subform search, you need to return the value of the
foreign key related to the main form. Then all you need do is have the main
form go to the record where the primary key in the main form has the same
value.

Steve
 
P

Pearl

hmmm. Then, there must be something wrong with how I associated the subform
to the main form because when I try to place my cursor in the subform field
to do a search, i get this message:

"you can't use Find or Replace now"
 
S

Steve

You don't say what your fields are so I'll give you an example ....

TblOrder
OrderID
<other general order fields>

TblOrderDetail
OrderDetailID
OrderID
<other line item fields>

OrderID is the PK in TblOrder and OrderID is the FK in TblOrderDetail. A
one-to-many relationship associates the two tables.

A main form is used to manage the data in TblOrder and a subform is used to
manage the data in TblOrderDetail.

You would do your search in the subform and return OrderID. Then you would
go to the main form record that has that value.

Steve
 
P

Pearl

That was the problem...thanks. I was trying to search thru the entire
database within a subform field that the mainform did not have
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top