If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Combo box in subform to filter separate subform
Hi,
After much searching thru posts and time spent entering code, I have decided to ask experts. I have a main form [fManufacturing] with subform 1 [fAssemblySubform] that has a combo box CboPartNumber (bound to PartNumber) based on query with following: SELECT tGeneralInfo.JobNumber, tAssemblySubform.PartNumber, tAssemblySubform.Hours FROM tGeneralInfo LEFT JOIN tAssemblySubform ON tGeneralInfo.JobNumber = tAssemblySubform.JobNumber; On same main form, I have subform 2 in datasheet view [fAssemblySubformByPartNumber] which is based on query with following: SELECT tWorkLog.JobNumber, tManufacturingPartNumber.PartNumber, Sum(DateDiff("n",[StartTime],[StopTime])) AS TotalTime FROM tWorkLog LEFT JOIN tManufacturingPartNumber ON tWorkLog.PartNumber = tManufacturingPartNumber.RecordNumber GROUP BY tWorkLog.JobNumber, tManufacturingPartNumber.PartNumber; What I want Subform 2 to do is list JobNumber, PartNumber and TotalTime when there is a match from CboPartNumber in Subform1. I thought this would be fairly easy - reference the combo box from sub1 in the query criteria grid of sub2 under PartNumber. Didn't work - subform only had headings. When I removed criteria and ran the query (not in subform), all was listed - not able to add, but don't need to - only view. I've tried requery in the AfterUpdate of sub1 combo box and other combinations, as well, and can't get this to work. Sub 2 is linked to the main form by job number - not sure if this matters. I even tried nesting the sub2 in sub1, but didn't like the results. Any help to figure this out is greatly appreciated! Thanks in advance, Pam |
Thread Tools | |
Display Modes | |
|
|