Remove the comma in front of FROM, need a space in front of FROM.
Don't need to concatenate empty string - two quote marks with nothing between them.
Really should save customer ID instead of customer name, probably same for items.
Remove the comma in front of FROM, need a space in front of FROM.
Don't need to concatenate empty string - two quote marks with nothing between them.
Really should save customer ID instead of customer name, probably same for items.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
In post 16 "need a space in front of FROM." See the syntax error where 44 runs into FROM. There is no space in front of FROM. Instead of "FROM should be " FROM.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
sorry , these two days I was far for using network
I did what you said , but also gave the same problem
this is attachment :
Update.zip
Umm, what exactly are you trying to do because that code snippet is not going to work. It looks like you want to update the values from from the Form to the Details table. If that is true then the FROM line is confusing the issue. Just use the values in the controls on the Form, i.e.
Code:UPDATE Details SET Details.ID = " & Me.SaleID & ", Details.sDate = " & Me.SaleDate & ", Details.CustomerName = '" & Me.CustName & "', Details.ItemsName = '" & Me.Sub!Items & "', Details.Qy = " & Me.Sub!Qy, Price =" & Me.Sub!Price, Details.Total = " & Me.Sub!Total & "
Doh! Head Slap! Glad Gina was on the ball!
Read through this thread again. Still confused why you are doing this. If Details is not a subform of SaleInvoice, what is? Why isn't it? Why are you duplicating data?
If you want to provide db for analysis, follow instructions at bottom of my post.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
it's updating data if I don't use Line of FROM , but it change all data to the same first line data
because we removed WHERE condition
this is real data in Form :
this is result after update in Details Table :
if We use FROM line , its gave us the same problem , but if we don't use it , it's updating data but with the same first data record
It's updating the data because it's what you told it to do. Why don't you help us out and tell us *exactly* what you want to happen. As a side note, you cannot UPDATE and INSERT using the same query.
Use WHERE clause if you want to limit UPDATE to a specific record.
Saving calculated data (data dependent on other data) is usually unnecessary and ill-advised. The calculated data can become 'out of sync' with raw data. The Total should be calculated when needed.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.