i have a form that handles treatments subscriptions magazines
e.x a customer buy 12 subscriptions of a magazine
now he pays me all the money for the 12 subscriptions
and every time he takes a magazine i reduce from the 12 1 magazine or even 2
the problem is i got messed up with the sold & left(remain) magazines form this customer
+ it updates the same customer name in 2 diffrent rows.
or if he take 2 magazines of the 12 then 10 is left right?
well the table shows me - 70 :confused:
i dont knw why
i tried to figure it out for a hour.
this is my code
txt(1).text 'Hold's the Quantity Purchased
TxtWorked.text Hold's the magazines he takes 'each month or even 2 in a month
TxtLeft.text ' the remain of the customers magazines
i am really confused here
what ever method i try its getting messy
these is the table values
if any more info is needed i will add
appreciate any help
regards salsa31
e.x a customer buy 12 subscriptions of a magazine
now he pays me all the money for the 12 subscriptions
and every time he takes a magazine i reduce from the 12 1 magazine or even 2
the problem is i got messed up with the sold & left(remain) magazines form this customer
+ it updates the same customer name in 2 diffrent rows.
or if he take 2 magazines of the 12 then 10 is left right?
well the table shows me - 70 :confused:
i dont knw why
i tried to figure it out for a hour.
this is my code
Code:
strSQL = "INSERT INTO Subscribers "
strSQL = strSQL & "(ID, SubEmpName, SubDate, SubCust, SubTreatment, SubQuantity, SubSold, SubLeft, SubPaymentMethod, SubPrice, SubTashlomim, SubTotal) "
strSQL = strSQL & "VALUES("
strSQL = strSQL & NewID & ","
strSQL = strSQL & "'" & RplS(CmbName.text) & "',"
strSQL = strSQL & "#" & MyDate(DTstart.Value) & "#,"
strSQL = strSQL & "'" & RplS(TxtDesc.text) & "'," ' name of the customer
strSQL = strSQL & "'" & RplS(CmbTreat.text) & "',"
strSQL = strSQL & "'" & RplS(Txt(1).text) & "',"'quantity of the magazines the customer purcase
strSQL = strSQL & "0,"
strSQL = strSQL & "'" & RplS(Txt(1).text) & "'," ' quantity of the magazines the customer purcase
strSQL = strSQL & "'" & RplS(CmbPayMethod.text) & "',"
strSQL = strSQL & CCur(RplS(Txt(6).text)) & ","
strSQL = strSQL & "'" & RplS(CmbTashlomim.text) & "',"
strSQL = strSQL & "'" & RplS(Txt(0).text) & "'"
strSQL = strSQL & ")"
CN.Execute strSQL
Code:
With FrmSubscribe.LsVw.SelectedItem
strSQL = "UPDATE Subscribers SET "
strSQL = strSQL & "SubDate = #" & MyDate(DTstart.Value) & "#"
strSQL = strSQL & " WHERE ID = " & .Tag
CN.Execute strSQL
strSQL = "Update Subscribers set SubSold = SubSold - " & RplS(Txt(1).text & ",")
strSQL = strSQL & " SubLeft = SubLeft - " & RplS(TxtWorked.text)
strSQL = strSQL & " where SubCust = '" & RplS(TxtDesc.text) & "'"
CN.Execute strSQL
TxtWorked.text Hold's the magazines he takes 'each month or even 2 in a month
TxtLeft.text ' the remain of the customers magazines
i am really confused here
what ever method i try its getting messy
these is the table values
Code:
Name of the table Subscribers
ID Number
SubEmpName text
SubDate Date/Time
SubCust text
SubTreatment text
SubQuantity text
SubSold text
SubLeft text
SubPaymentMethod text
SubPrice Currency
SubTashlomim text
SubTotal Currency
appreciate any help
regards salsa31