 |
| Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

June 11th, 2003, 10:35 AM
|
|
Registered User
|
|
Join Date: Jun 2003
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Searching a subform
I'm using MS Access 97 and I have a form with a subform on it which has it's child and master fields linked. Without doing this I can't get two fields to work together so this is a must. The problem is once I link the child and master fields I'm no longer able to search on the subform though I can on the regular form. There are well over 50 fields on the subform and in excess of 600 records and I need to be able to search any of the fields on the subform or main form at any given time. If anyone needs any more clarification on anything I'd be happy to provide it. Any help is very much appreciated. Thanks.
DanieljF
|
|

June 11th, 2003, 11:16 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 308
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
I just tried to replicate yr problem - and I can't - linking a form and a subform in a 1 to many relationship in the stock standard Form Wizard way still allows subform searching (well to be accurate - "Finding" - using Ctrl+F, which I assume is what yr on about)
Of course it only allows for finding within the current records in the subform - i.e. those related to the record on the main form.
So I'm assuming yr doing [u]something</u> that's not just yr standard everyday form/subform. Is this the case?
Steven
There are 10 kinds of people in the world - those who understand binary - and those with friends
|
|

June 12th, 2003, 08:50 AM
|
|
Registered User
|
|
Join Date: Jun 2003
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Unforunately I didn't set up the form in the first place and don't have contact with who did so I can't say for sure but what I do know is that it seems to be a form with a subform put on using the toolbox tool (I'm guessing, that's how I did it when I tried to recreate it myself). There's a field or two on the subform (though all of the fields will probably be searched at one point or another) that aren't the linked fields and do not appear on the main form that need to be searched. Since my original post I've learned this may be possbile but through VBA code. As I have little to no experience with this I'm afraid it won't help much unless the code is available in the public domain somewhere. Any more help getting this "monkey off my back" would be much appreciated.
DanieljF
|
|

June 13th, 2003, 12:05 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 308
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
They're not unbound textboxes you're trying to search in are they?
There are 10 kinds of people in the world - those who understand binary - and those with friends
|
|

June 17th, 2003, 08:25 AM
|
|
Registered User
|
|
Join Date: Jun 2003
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
The textboxes are bound. Still having the problem so still any help is greatly appreciated.
DaniejF
|
|

September 16th, 2004, 12:17 AM
|
|
Registered User
|
|
Join Date: Oct 2003
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hi, Daniel.
Have you ever checked your Subform Properties? Maybe you can find the answer for your problem there. :)
Herru
|
|

September 17th, 2004, 12:45 PM
|
|
Friend of Wrox
|
|
Join Date: Jul 2003
Posts: 128
Thanks: 0
Thanked 1 Time in 1 Post
|
|
Daniel,
Would you consider, to make things easier, having one form from one table, then after updating fields it will update other related tables by ADODB codes. Within the form too, will have a button to navigate/link to the Form (Child/subform) it was updated to.
Let me know if this may help you.
John
|
|

July 28th, 2005, 10:10 AM
|
|
Registered User
|
|
Join Date: Jul 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
I am currently have the same problem mentioned here and of all Access problems i have seen, helped with and come accross i have never ever seen a fix for this one! I have knowledge of VB and VBA and i cant come to a reasonable fix, if there is anyone out there who can design a fit way of searching both a main form and its subform child at once it would be very much appreciated. Thanks.
Ash
|
|

July 28th, 2005, 12:01 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
|
|
Actually, there's nothing that needs "fixing." When you link a subform to a form via child/master, you're telling Access that the subform data is to be filtered to the data that applies to the primary key of the main form. Therefore, searching the subform only searches those records that apply to THAT main record. That's how it's supposed to work.
If you want to find ANY record in the subform that matches ANY record in the main form, you can do that by putting an unbound combobox on your main form, make its rowsource equal to a list of the field in the subform, and its AfterUpdate event would move the current record on the main form to the first instance where data on the subform matches your criteria.
Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division
|
|
 |