Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Run SQL don not update

Status
Not open for further replies.

starclassic

Technical User
Joined
May 24, 2007
Messages
27
Location
US
Here's my sql statement to update yes/No and date where IndexID(primary key) is the current record selected.

DoCmd.RunSQL "UPDATE tblCreditDetails SET tblCreditDetails.ysnSentByMailToStaff = -1, tblCreditDetails.dteFUDate = Date() WHERE (tblCreditDetails.IndexID = '" & Me!txtIndexID1 & "')"

But will not update.
 
Do you get an error message?

Ed Metcalfe.

Please do not feed the trolls.....
 
try using now() instead of date()

and check the value of Me!txtIndexID1, you've got string delimiters in there, so is tblCreditDetails.IndexID a string datatype?

--------------------
Procrastinate Now!
 
IndexID is a Primary and its a Autonumber
 
I got it working now... Thanks everyone.
 
Here's the final SQL statement
DoCmd.RunSQL "UPDATE tblCreditDetails SET tblCreditDetails.ysnSentByMailToStaff = -1, tblCreditDetails.dteFUDate = Date() WHERE tblCreditDetails.IndexID = " & CStr(Me.txtIndexID1)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top