S
Someone
Hello
I need to incorporate a search facility into my database. Let me give a
simple overview on how it's set up.
There is a main form which has a subform in datasheet view. The subform is
based on a query to a table (call it table a). The reason for this is that
the main form has unbound text boxes so users can search the data in the
subform (the view is requeried to show like records on the data entered -
Like "*" & [FormControlName] etc).
Amongst the buttons on the main form is one to open another form with three
tabs. The form opens to the same record that is selected in the main form's
subform. The default tab shows ALL fields of the record selected from the
subform. On the second tab is another subform in form view for a different
table (call it table b - it's actually a table of contact details). The
third tab is irrelevant for this post.
The relationship between table a and b is a one-to-many, where 1 record in
table a can refer to many records in table b (i.e. a record in table a could
have more than one contact name and/or address).
I've been asked to incorporate a search facility on the contacts (table).
It would need to locate the related record in table a (i.e. the master
record). The problem is, I can't figure out the best way to do it.
Ideally, I'd like to have a search form with textboxes that the user can
fill in with their required search criteria. This then finds the related
record in table a, based on the search just made on table b. If possible,
I'd like this to requery the data on the main form's subform so the user can
click open the record of their choosing. I've tried, but it's gone beyond
me. Do anyone of you have any ideas on how you would go about this and what
I'd need to do to accomplish it? You might think my idea is
over-complicated and that there is a more straight-forward idea to fulfil
this.
I do hope I haven't sounded too vague in my request. If you need further
detail, I'm happy to supply it.
Many thanks for your time
M
I need to incorporate a search facility into my database. Let me give a
simple overview on how it's set up.
There is a main form which has a subform in datasheet view. The subform is
based on a query to a table (call it table a). The reason for this is that
the main form has unbound text boxes so users can search the data in the
subform (the view is requeried to show like records on the data entered -
Like "*" & [FormControlName] etc).
Amongst the buttons on the main form is one to open another form with three
tabs. The form opens to the same record that is selected in the main form's
subform. The default tab shows ALL fields of the record selected from the
subform. On the second tab is another subform in form view for a different
table (call it table b - it's actually a table of contact details). The
third tab is irrelevant for this post.
The relationship between table a and b is a one-to-many, where 1 record in
table a can refer to many records in table b (i.e. a record in table a could
have more than one contact name and/or address).
I've been asked to incorporate a search facility on the contacts (table).
It would need to locate the related record in table a (i.e. the master
record). The problem is, I can't figure out the best way to do it.
Ideally, I'd like to have a search form with textboxes that the user can
fill in with their required search criteria. This then finds the related
record in table a, based on the search just made on table b. If possible,
I'd like this to requery the data on the main form's subform so the user can
click open the record of their choosing. I've tried, but it's gone beyond
me. Do anyone of you have any ideas on how you would go about this and what
I'd need to do to accomplish it? You might think my idea is
over-complicated and that there is a more straight-forward idea to fulfil
this.
I do hope I haven't sounded too vague in my request. If you need further
detail, I'm happy to supply it.
Many thanks for your time
M