Have problem with a form i want to use as both a standalone form and a subform.
The scenario:
Form_Customer (the main form)
Form_Customer_Orders (the form i want to use as both standalone and subform)
And in Form_Customer_Orders i have a listbox_orders with a list of orders
listbox_orders have this rowsource "SELECT * FROM Orders WHERE CustomerID = [Forms]![Form_Customer_Orders]![CustomerID]"
This works well when i use the form as a standalone.
However if i use it as a linked subform in Form_Customer i get error on the [Forms]![Form_Customer_Orders]![CustomerID] as it not loaded.
If i change the rowsource for the listbox to "SELECT * FROM Orders WHERE CustomerID = [Forms]![Form_Customer]![CustomerID]" it works as a linked subform but not a standalone form anymore.
How do i solve this?
I could do it with vba but is there not a better way?
// Regards Guroth