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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

RunSQL to clear one collumn of daata 2

Status
Not open for further replies.

RonMcIntire

Technical User
Oct 12, 2002
166
0
0
US
I have tried my level best but nothing seems to work. Can anyone help?

Here is my code:

Sub cmdResetRecSent_Click()

Dim strSQL As String

strSQL = "UPDATE [tblHOA MEMBERs] SET [tblHOA MEMBERs].RecSent WHERE ((([tblHOA MEMBERs].Member) = -1))"

DoCmd.SetWarnings False
DoCmd.RunSQL strSQL
DoCmd.SetWarnings True

End Sub

Thanks
Ron Mc
 
You don't have any value you are setting RecSent to. I would expect you need something like the following:

Code:
Sub cmdResetRecSent_Click()

  Dim strSQL As String

  strSQL = "UPDATE [tblHOA MEMBERs] SET [tblHOA MEMBERs].RecSent[highlight #FCE94F] = -1[/highlight]  WHERE Member = -1"

  DoCmd.SetWarnings False
  DoCmd.RunSQL strSQL
  DoCmd.SetWarnings True

End Sub

Duane
Minnesota
Hook'D on Access
MS Access MVP 2001-2016
 
dhookom:

Thanks. Surprising that one error like this can slip through. Actually, this should be null.
Works fine now.
Ron
 
Ron,

Don't you think Duane deserves a star for his quick and helpful post?


---- Andy

There is a great need for a sarcasm font.
 
Wrong post for the star - I didn't do anything.
Duane helped you, on New Year's Eve!!! [wiggle]


---- Andy

There is a great need for a sarcasm font.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top