Please help, i do not know whats causing the problem...
Dim miqty As Double
Dim mitc As Double
Dim siqty As Double
Dim sitc As Double
Dim diffqty As Double
Dim difftc As Double
Dim dvqty As Double
Dim dvtc As Double
dvqty = dynavqty.Text
dvtc = dynavtc.Text
Set editSIrs = New ADODB.Recordset
With editSIrs
.Open "SELECT MainInventory.ItemCode AS mic, MainInventory.Quantity AS miq, MainInventory.TotalCost AS mit, StockIn.ItemCode AS SIC, StockIn.ID AS si, StockIn.Quantity AS sq, StockIn.UnitCost AS su, StockIn.TotalCost AS st From maininventory, stockin", editSIcn, 2, 3
Do While Not .EOF
If icsearchtxt.Text = !mic And icsearchtxt.Text = !sic And idtxt.Text = !si Then
miqty = mainqty.Text
mitc = maintc.Text
siqty = origqty.Text
sitc = origtc.Text
diffqty = miqty - siqty
difftc = mitc - sitc
!miq = diffqty + dvqty
!mit = difftc + dvtc
!sq = dynavqty.Text
!su = dvuc.Text
!st = dynavtc
.Update
Exit Do
Else
.MoveNext
End If
Loop
End With