I have a form 'frmMain' where I have an unbound text box 'txtDate' with a date. I use this date to run reports/update databases.
In another form 'frmCustRFQ1' I use this date to fetch a rate from a table using Dlookup (see below)in an unbound textbox called 'txtRMRate'. The rate fetched from the table is based on the value of txtDate. This value is updating as an when txtDate or RMType is changed
=IIf([RMType]='PP',DLookUp("PP","tblcustRMPriceMaster","Endcustcode='" & [tblCustRFQ1.EndCustomerCode] & "' AND
Month([forms]![frmMain]![txtDate])=month([pricedate]) AND Year([forms]![frmMain]![txtDate])= Year([pricedate])"),DLookUp("HDPE","tblcustRMPriceMaster","Endcustcode='" & [tblCustRFQ1.EndCustomerCode] & "' AND
Month([forms]![frmMain]![txtDate])=month([pricedate]) AND Year([forms]![frmMain]![txtDate])= Year([pricedate])"))
I need to store this value of 'txtRMRate' in the table which is bound to the frmRFQ. the bound control name is 'RMRate'
I added the code me.txtRMRate = me.RMRate in Afterupdate of the combobox RMType and the RMRate is updated when RMType is updated
However when I change the value of txtDate in frmMain, txtRMRate is updated but not the value RMRate. I added the code me.txtRMRate = me.RMRate in AfterUpdate and OnChange events of txtRMType but the value is not updated!
Where am I going wrong?
Adding [forms]![frmCustRFQ1].[txtRMRate] = [forms]![frmCustRFQ1].[RMRate] in Afterupdate of the txtdate control in frmMain produces an error!
In another form 'frmCustRFQ1' I use this date to fetch a rate from a table using Dlookup (see below)in an unbound textbox called 'txtRMRate'. The rate fetched from the table is based on the value of txtDate. This value is updating as an when txtDate or RMType is changed
=IIf([RMType]='PP',DLookUp("PP","tblcustRMPriceMaster","Endcustcode='" & [tblCustRFQ1.EndCustomerCode] & "' AND
Month([forms]![frmMain]![txtDate])=month([pricedate]) AND Year([forms]![frmMain]![txtDate])= Year([pricedate])"),DLookUp("HDPE","tblcustRMPriceMaster","Endcustcode='" & [tblCustRFQ1.EndCustomerCode] & "' AND
Month([forms]![frmMain]![txtDate])=month([pricedate]) AND Year([forms]![frmMain]![txtDate])= Year([pricedate])"))
I need to store this value of 'txtRMRate' in the table which is bound to the frmRFQ. the bound control name is 'RMRate'
I added the code me.txtRMRate = me.RMRate in Afterupdate of the combobox RMType and the RMRate is updated when RMType is updated
However when I change the value of txtDate in frmMain, txtRMRate is updated but not the value RMRate. I added the code me.txtRMRate = me.RMRate in AfterUpdate and OnChange events of txtRMType but the value is not updated!
Where am I going wrong?
Adding [forms]![frmCustRFQ1].[txtRMRate] = [forms]![frmCustRFQ1].[RMRate] in Afterupdate of the txtdate control in frmMain produces an error!