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 visibility

Status
Not open for further replies.

ssatech

Technical User
Feb 27, 2003
361
IE
I have a main form (Inventory Details) and a subform - continous (WO allocation)
The main forms record source:
SELECT DISTINCTROW [Parts ].[Part No], [Parts ].Description, [Parts].Date,[Parts].Update, [Parts].Cost, [Parts].Code, [Parts].Stock, [Parts].Stocked, [Parts].UOM, [Parts].Note, [Parts].Price
FROM [Parts]
ORDER BY [Parts].[Part No];

The subform is linked to Main form by :
Link Child Field: Part No
Link Child Field: Part No


SELECT DISTINCTROW [W-Order].[W-Order], [W-Order].Qty, [W-Order].Status, [BOM].Qty, [BOM].Parent, [Parts].[Part No]
FROM [W-Order] LEFT JOIN ([BOM] LEFT JOIN [Parts] ON [BOM].Parts = [Parts].[Part No]) ON [W-Order].Product = [BOM].Parent
WHERE ((([W-Order].Status)="Checkout" Or ([W-Order].Status)="Hold"))
ORDER BY [W-Order].[W-Order];

My problem is when the record selector is use to browse records in this form . If no records exist for this link, then subform is blank/greyed out - not OK. If a record exists then records is visible for the link in continous view - this is OK. But is there a way to have the subform show the fields in continous view even though no records exist for the linked – In other words show the subform fields even though fields are non-edit.


Any help appreciated
 
you can use DCount to check for "no records" on your subform

if DCount (SELECT DISTINCTROW [W-Order].[W-Order], [W-Order].Qty, [W-Order].Status, [BOM].Qty, [BOM].Parent, [Parts].[Part No]
FROM [W-Order] LEFT JOIN ([BOM] LEFT JOIN [Parts] ON [BOM].Parts = [Parts].[Part No]) ON [W-Order].Product = [BOM].Parent
WHERE ((([W-Order].Status)="Checkout" Or ([W-Order].Status)="Hold"))
ORDER BY [W-Order].[W-Order]) = 0 then

me!subform.enabled = true.

I think this is might work.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top