I have a continuous subform where I am facing an issue.
The record source of the subform is included as Picture 1. The record source in datasheet view is Picture 2
The Subform in Form view is Picture 3. The problem I face is that the moment I start a new record in the sub form I get an error in one field see ID no 16. When I save the form, I get message as in Picture 4.
The qry used in the sub form qryRealisation is shown in Picture 5.
If I close the form and reopen it , there is no error and all data is in place. It is a requery issue possibly and I tried requery in after update of different fields and also on Current events of the sub form, but cannot resolve the issue.
The 2 expressions which are giving an error are as below
ExRate: IIf([SalesCurr]="USD",DLookUp("USD","tblexchangerates","month(monthyear)=" & Month([pricedate]) & " and year(monthyear)=" & Year([pricedate]) & ""),IIf([SalesCurr]="EUR",DLookUp("EUR","tblexchangerates","month(monthyear)=" & Month([pricedate]) & " and year(monthyear)=" & Year([pricedate]) & ""),DLookUp("GBP","tblexchangerates","month(monthyear)=" & Month([pricedate]) & " and year(monthyear)=" & Year([pricedate]) & "")))
SalesRateINR: [salesrate]*[ExRate]
SalesINRPerkg: (IIf([tblsalesdata].[UOMID]=1,[salesrateinr]/1000/[convrate]*[BagWtCorr],IIf([tblsalesdata].[UOMID]=2 Or [tblsalesdata].[UOMID]=3 Or [tblsalesdata].[UOMID]=11,[salesrateinr]/1000/[convrate],IIf([tblsalesdata].[UOMID]=4 Or [tblsalesdata].[UOMID]=5 Or [tblsalesdata].[UOMID]=6 Or [tblsalesdata].[UOMID]=7,[salesrateinr]/1000/([convrate]*[FinalGSM]*[widthbagorfabric]),[salesrateinr]/1000/([convrate]*[FinalGSM])))))*(1-Nz([Discounttotal],0))-Nz([appfreight],0)
Can someone help
The record source of the subform is included as Picture 1. The record source in datasheet view is Picture 2
The Subform in Form view is Picture 3. The problem I face is that the moment I start a new record in the sub form I get an error in one field see ID no 16. When I save the form, I get message as in Picture 4.
The qry used in the sub form qryRealisation is shown in Picture 5.
If I close the form and reopen it , there is no error and all data is in place. It is a requery issue possibly and I tried requery in after update of different fields and also on Current events of the sub form, but cannot resolve the issue.
The 2 expressions which are giving an error are as below
ExRate: IIf([SalesCurr]="USD",DLookUp("USD","tblexchangerates","month(monthyear)=" & Month([pricedate]) & " and year(monthyear)=" & Year([pricedate]) & ""),IIf([SalesCurr]="EUR",DLookUp("EUR","tblexchangerates","month(monthyear)=" & Month([pricedate]) & " and year(monthyear)=" & Year([pricedate]) & ""),DLookUp("GBP","tblexchangerates","month(monthyear)=" & Month([pricedate]) & " and year(monthyear)=" & Year([pricedate]) & "")))
SalesRateINR: [salesrate]*[ExRate]
SalesINRPerkg: (IIf([tblsalesdata].[UOMID]=1,[salesrateinr]/1000/[convrate]*[BagWtCorr],IIf([tblsalesdata].[UOMID]=2 Or [tblsalesdata].[UOMID]=3 Or [tblsalesdata].[UOMID]=11,[salesrateinr]/1000/[convrate],IIf([tblsalesdata].[UOMID]=4 Or [tblsalesdata].[UOMID]=5 Or [tblsalesdata].[UOMID]=6 Or [tblsalesdata].[UOMID]=7,[salesrateinr]/1000/([convrate]*[FinalGSM]*[widthbagorfabric]),[salesrateinr]/1000/([convrate]*[FinalGSM])))))*(1-Nz([Discounttotal],0))-Nz([appfreight],0)
Can someone help