Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21100

[RESOLVED] how to not update a specific subitem or field

$
0
0
is there a way to not update a specific subitem without getting a error?

i have inventory and 2 text that are equal InvRemain & InvQuantity
now in the form load i did that the InvRemain will be equal to InvQuantity however when i update this purchase
and press update after i sold 2 items its still remains the same InvRemain .(if i press edit then txt that holds the InvQuantity is locked so no changes can be made)
what i want to do is if i change lets say the bill number or what ever then the InvQuantity wont be affected.
is there a way to do so ?without getting errors?
i just dont want to update the InvQuantity thats it
this is my code for the update
Code:

strSQL = "UPDATE Inventory SET "
strSQL = strSQL & "InvDate = #" & MyDate(PickDate.Value) & "#,"
strSQL = strSQL & "InvItem = '" & RplS(Txt(0).text) & "',"
strSQL = strSQL & "InvQuantity =  " & CCur(Txt(1).text) & ","
strSQL = strSQL & "InvBeforetax = " & CCur(Txt(2).text) & ","
strSQL = strSQL & "InvInvoice = '" & Txt(3).text & "',"
strSQL = strSQL & "InvSupplier = '" & Cmb3.text & "',"
strSQL = strSQL & "InvEmail= '" & RplS(Txt(4).text) & "',"
strSQL = strSQL & "InvPhone = '" & Txt(5).text & "',"
strSQL = strSQL & "InvBranch= '" & RplS(Txt(6).text) & "',"
strSQL = strSQL & "InvFax= '" & Txt(7).text & "',"
strSQL = strSQL & "InvCompany='" & RplS(Txt(8).text) & "',"
strSQL = strSQL & "InvPaymentMethod= '" & Cmb1.text & "',"
strSQL = strSQL & "InvPayments= '" & Cmb2.text & "',"
strSQL = strSQL & "InvParts='" & RplS(Txt(9).text) & "',"
strSQL = strSQL & "InvExpire= #" & MyDate(DTfinal.Value) & "#,"
strSQL = strSQL & "InvTax=  " & CCur(Txt(10).text) & ","
strSQL = strSQL & "InvAfterTax= " & CCur(Txt(11).text) & ","
strSQL = strSQL & "InvForCust = '" & Txt(12).text & "',"
strSQL = strSQL & "InvTotal=  " & CCur(Txt(13).text) & ","
strSQL = strSQL & "InvPhoto = '" & CustPhoto & "',"
strSQL = strSQL & "InvStatus= '" & CmbStat.text & "',"
strSQL = strSQL & "InvSold=  " & CCur(Txt(15).text) & ","
strSQL = strSQL & "InvRemain=  " & CCur(Txt(16).text) & ","
strSQL = strSQL & "InvRemarks = '" & RplS(Txt(14).text) & "'"
strSQL = strSQL & " WHERE InvID = " & .Tag
CN.Execute strSQL

if any information is needed i will add it
regards salsa31

Viewing all articles
Browse latest Browse all 21100

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>