Hi John,
It seems I get a I compile error (line turns red) and pop up msg "Expected End of Line Statement" and the word "SET" gets highlighted. Let me know what is next....thanks!
Where are you putting the code...this is a sample SQL query...without further knowledge i can only guess.
I am putting the code on a button on frmPricing that is based on tblPricing. The form has [Calc Price] that is a calculated field in tblPricing. I have a button on frmPricing that if clicked will update that Calc Price to the value in tblLetterOfCredit.Amount. I hope this answers your question. Let me know I am not making it clear.
If this the case then
Update tblLetterOfCredit SET Amount =" & Me.[Calc Price]& " WHERE LetterOfCreditID =" & me.LCID
darn...I get the same compile error expected end of statement pop up msg.
I copy and paste exactly and the line is red. I thought maybe a space was off and I modify and once I move off the line the pop up msg compile error pops up and SET is highlighted.
you execute it like this
Docmd.RunSQL " Update tblLetterOfCredit SET Amount =" & Me.[Calc Price]& " WHERE LetterOfCreditID =" & me.LCID
Are they 2 separate lines? If so, it doesnt allow me to copy exactly like as so. Docmd.RunSQL "....will change to Docmd.RunSQL " "...it adds another dq.
No, 1 line as the screenshot
Do I need to add currentdb.execute?
CurrentDb.Execute "Update tblLetterOfCredit SET Amount =" & Me.[Calc Price] & " WHERE LetterOfCreditID =" & Me.LCID
Thank you. It seemed to work if I added the currentdb.execute. Thanks for the code...appreciate it!
Docmd.RunSQL should also work
Open in new window
Well an UPDATE query looks like this..but i am afraid I don't have the Relationships between the tables