D
drewship
Hello all. This was posted under a different title but received no responses
so I am resubmitting this.
What I have is a subform based on the below query which works correctly up
to a point.
SELECT [Order Details].*, Products.*, CCur(Nz([Quantity],0)*[UnitPrice]) AS
[Extended Price], [Order Details].ServiceType, Products.[Service Type]
FROM Products INNER JOIN [Order Details] ON Products.ProductID = [Order
Details].ProductID;
There is a field on the 'Order Details Subform' called 'ServiceType' that
has a control source of 'Products.Service Type' and is set using a 'Set'
macro with an Item of [ServiceType] and an expression of 'DLookUp("[Service
Type]","Products","ProductID = " & [ProductID])'. This correctly populates
the subform with the 'Service Type' from the 'Products' table.
The problem I am having is I need the value of 'ServiceType' to be saved to
an 'Orders Details' table in the 'Service Type' field. Since the Control
Source is already being used by 'Products.Service Type'. I tried using the
below 'Set' macro (just one example of many things I tried...this seems the
most logical to me) to take the value of 'ServiceType' from the 'Order
Details Subform' and save it to the 'Orders Details' table', but this does
not work.
This is located in the 'After Update' section of the 'Order Details Subform'
'ServiceType' field. I believe that after the 'ServiceType' field is updated,
the macro should run and save the current value of 'ServiceType' to the
desired table, but it does not.
Item is set to '[Order Details]![Service Type]'
Expression is set to '[Forms]![Add an Order and Details]![Order Details
Subform].[Form]![ServiceType]'
Can someone please help me out? Thanks in advance!!
so I am resubmitting this.
What I have is a subform based on the below query which works correctly up
to a point.
SELECT [Order Details].*, Products.*, CCur(Nz([Quantity],0)*[UnitPrice]) AS
[Extended Price], [Order Details].ServiceType, Products.[Service Type]
FROM Products INNER JOIN [Order Details] ON Products.ProductID = [Order
Details].ProductID;
There is a field on the 'Order Details Subform' called 'ServiceType' that
has a control source of 'Products.Service Type' and is set using a 'Set'
macro with an Item of [ServiceType] and an expression of 'DLookUp("[Service
Type]","Products","ProductID = " & [ProductID])'. This correctly populates
the subform with the 'Service Type' from the 'Products' table.
The problem I am having is I need the value of 'ServiceType' to be saved to
an 'Orders Details' table in the 'Service Type' field. Since the Control
Source is already being used by 'Products.Service Type'. I tried using the
below 'Set' macro (just one example of many things I tried...this seems the
most logical to me) to take the value of 'ServiceType' from the 'Order
Details Subform' and save it to the 'Orders Details' table', but this does
not work.
This is located in the 'After Update' section of the 'Order Details Subform'
'ServiceType' field. I believe that after the 'ServiceType' field is updated,
the macro should run and save the current value of 'ServiceType' to the
desired table, but it does not.
Item is set to '[Order Details]![Service Type]'
Expression is set to '[Forms]![Add an Order and Details]![Order Details
Subform].[Form]![ServiceType]'
Can someone please help me out? Thanks in advance!!