Reputation: 0 Apprentice
- Active Posts:
- 47 (0.03 per day)
- 25-August 09
- Profile Views:
- Last Active:
- Aug 28 2012 07:09 AM
- Dream Kudos:
Posts I've Made
Posted 5 Feb 2012You have to put the #'s as part of the string, not around the Text1.text, otherwise you would get a syntax error??
Look at what you've written and said that works.
Something like below, should work
Quote"DELETE From ControlDetailsA where [Date] <= #" & Text1.Text & "#"
maj3091 thanks a ton. Works like a charm
Posted 5 Feb 2012if I use the code below it works properly if I put a specific date in the code
"DELETE From ControlDetailsA where [Date] <= #4/2/2011#"
If I however want to change the query to use a date stored in text1.text field I'm having trouble with it. The idea is to delete all records <= to the date stored in text1.text,
the value in text1 text = 5/11/2011 (Text1.Text = Format$(test, "d/m/yyyy")
I have tried "DELETE From ControlDetailsA where [Date] <= " & Text1.Text NOTHING DELETED
"DELETE From ControlDetailsA where [Date] <= " & #Text1.Text# SYNTAX ERROR
"DELETE From ControlDetailsA where [Date] <= #text1.text#" SYNTAX ERROR
Posted 5 Feb 2012You SQL query doesn't look right.
You don't Delete * from table, you just Delete from table and your date text should be cast as a date. I'm not 100% sure on the access syntax, but I think it might be #date#, so your query would be something like
Delete from Table where [Date]<= #date#
Thanks for the reply. I'm still not getting it to actually delete the records in access table
- Member Title:
- New D.I.C Head
- Age Unknown
- Birthday Unknown
raycomp hasn't added any friends yet.