A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Combo box in subform to filter separate subform



 
 
Thread Tools Display Modes
  #1  
Old January 9th, 2007, 07:45 PM posted to microsoft.public.access.forms
PHisaw
external usenet poster
 
Posts: 224
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 05:04 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.