Question:
Delete query is not working? help [visual basic and ms access]?
raja
2007-06-18 13:27:14 UTC
simply I want to delete record according to date. the date I entered in text box should be matched to delete a record.

My query is
conn1.Execute "delete from Liquidation_Value where Date = " & Dates.Text & ";"

Column name in database is date where as name of text box is dates.

When I run the query, it does nothing.

I tried to match every date type in vb and ms access but failed
Four answers:
alexrogo
2007-06-18 13:31:02 UTC
Try this:



"Delete * FROM Liquidation_Value WHERE Date=#" & Dates.Text & "#"



You should rename that Date field in your table since Date is a reserved word in VBA and Access.



Rename it to LiquidDate:

"Delete * FROM Liquidation_Value WHERE LiquidDate=#" & Dates.Text & "#"
BlueFeather
2007-06-18 17:11:11 UTC
For fields defined as Date/Time datatype, Access stores hour and minute as well as Month, Day, Year. Depending on how the data was entered, you may find it extremely difficult to find matching records.



If the hour and minute were stored when adding/modifying records, then they MUST also be included in your query when looking for an exact match. If the hour and minute are not critical, you might want to change your query to use Less Than (<), Less Than Or Equal (<=), and so on. That will most likely result in a dataset containing records you want to delete.

ยง
2016-09-28 05:15:22 UTC
expensive buddy ! open the seen elementary 6.0 click on the upload ins menu.after picking that determination an pop memu will apper referred to as addins. click in this determination u would be discover an small verbal replace field appers referred to as seen records supervisor. on that determination u can open an msaccess report in vb.
akr_tx
2007-06-18 13:34:24 UTC
If all else fails try:



www.tek-tips.com



They have endless help on Access


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...