tsql - MS-Access - how to trigger data insert before LostFocus event? -


I have a process that runs on to a control AfterUpdate Event:

  Private sub cmdDelCountry_AfterUpdate () dim strID string strID = cmdCommand as Me.ID with new ADODB.Command as strCase string strCase = 1 dim cmdCommand .acticConnection = CurrentProject.Connection .CommandType = adCmdStoredProc. CommandText = "uspSalesOrderHead_UPDATE" '@RowID .Parameters ("@RowID") Value = strID '@case .Parameters ("@ episode"). Value End Sub with = strCase .Execute end  

to process some data on a stored SQL Server process server executes the process:

  ALTER process as uspSalesOrderHead_UPDATE (@RowID integer, @Case integer) that @Case = 1 / * Select country of delivery * / start / * order order Head table * / UPDATE dbo.tblSalesOrderHead SET dbo.tblSalesOrderHead.txtRegionCode = dbo. Tblsetingko Untrikdektshtrgiankde, Dboktblslesrderhedktshtkurrensikde = Dboktblsetingkauntrikdektshtkurrensikde, Dboktblslesrderhedktstlanguagekde = Dboktblsetingkauntrikdektstlanguagekde Dboktb Joined interior of lSalesOrderHead dbo.tblSalesOrderHead.txtDelCountry = dbo.tblSettingCountryCode.txtCountryCode and Dbo DboktblSettingCountryCode which .tblSalesOrderHead.ID = @RowID; / * Update / Update Order Line Table dbo.tblSalesOrderLine SET dbo.tblSalesOrderLine.txtRegionCode = dbo.tblSalesOrderHead.txtRegionCode, dbo.tblSalesOrderLine.txtCurrencyCode = dbo.tblSalesOrderHead.txtCurrencyCode FROM dbo.tblSalesOrderLineInnerJoin dbo.tblSalesOrderHead ON dbo. TblSalesOrderLine IntOrderNo = dbo.tblSalesOrderHead.ID and dbo.tblSalesOrderLine.intOrderNo = @RowID; End  

The problem is that the value of the control ( cmdDelCountry ) is not included in the price table ( dbo.tblSalesOrderHead ) before it is Has been requested by the stored SQL process: Join interiors dbo.tblSettingCountryCode on dbo.tblSalesOrderHead.txtDelCountry = dbo.tblSettingCountryCode.txtCountryCode

How can I insert data before performing the stored procedure?

You can use (on the form)

 < Code> If Me.Dirty is forced to save Me.Dirty = false  

, but it can be better click on


Comments

Popular posts from this blog

c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

Calling GetGUIThreadInfo from Outlook VBA -

Obfuscating Python code? -