Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SubForm Doesn't Update completely.

Status
Not open for further replies.

Koolaid99

MIS
Mar 19, 2002
33
US
I have 2 tables one table list parts out and has 2 linebuy fields. A primary and secondary. I have a query that Filters it.
Example
Table 1
Part_Number Price Linebuy1 Linebuy2
ABCDE $3.00 abc def
CDEFG $4.00 def fgh
XYZABC $5.00 xyz abc

Table 2
LineBuy Desc
abc Blah Blah
def Blah Blah
fgh Blah Blah
xyz Blah Blah

Ok now I have a query like this:
Field Part_Number Price Linebuy1 Linebuy2
Critieria =[FormValue]
Or =[FormValue]

This query does work and will show this if I enter the formValue "abc"
Part_Number Price Linebuy1 Linebuy2
ABCDE $3.00 abc def
XYZABC $5.00 xyz abc

Now I have this query in a Form and it works also. Now when I enter this into as a sub form and the main form does have this field it will only show :
Part_Number Price Linebuy1 Linebuy2
ABCDE $3.00 abc def

It cuts out the second linebuy filter. Why does it do this. I have my relation ships set up correct and works fine until I view it from the Main form and not the query or subform. Is there some other setting I'm missing? I had this working before but I added a extra field. So I started over and made it again from scratch with this field added but it still doesn't work. I don't really know what I am missing.
 
Can you post the SQL for the queries, it will be much easier to see what is happening and remove any interpretation.
 
Ok don't know how well this will turn out. I'm trying to make Electronic price books to e-mail to customers. This is SQL View for my Query.

SELECT MasterPartList.PartNumber, MasterPartList.Description, MasterPartList.Price, MasterPartList.CustNumber, MasterPartList.LB1, MasterPartList.LB2, MasterPartList.UM
FROM Linebuy RIGHT JOIN MasterPartList ON (Linebuy.LineBuy = MasterPartList.LB2) AND (Linebuy.LineBuy = MasterPartList.LB1)
WHERE (((MasterPartList.LB1)=[Forms]![Linebuy]![Line_buy])) OR (((MasterPartList.LB2)=[Forms]![Linebuy]![Line_buy]));
 
You could try this.
SELECT MasterPartList.PartNumber, MasterPartList.Description, MasterPartList.Price, MasterPartList.CustNumber, MasterPartList.LB1, MasterPartList.LB2, MasterPartList.UM
FROM MasterPartList LEFT JOIN Linebuy ON (Linebuy.LineBuy = MasterPartList.LB2) OR (Linebuy.LineBuy = MasterPartList.LB1)
WHERE (((MasterPartList.LB1)=[Forms]![Linebuy]![Line_buy])) OR (((MasterPartList.LB2)=[Forms]![Linebuy]![Line_buy]));

These both cannot be true on the same record.
(Linebuy.LineBuy = MasterPartList.LB2) AND (Linebuy.LineBuy = MasterPartList.LB1)
 
Still doesn't work as intended. I have my query doing what I want and switching it does work the same. (Although I can't go into design view?) Thing is when I use the query through a subform it doesn't show data that is picked up from the second LineBuy. It seems as though that "OR" statement is getting picked up. I think I may have to figure a diffrent way. [flush]
 
Maybe you are overriding the query on the subform. What is in the linked fields for the subform? Is it linked to a table or query? What is in the recordsource for the subform? Check these out.
 
Woohoo!! Had invailed links in the link child and Link master deleted them out and it works now. Thanks for the help
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top