By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,506 Members | 1,891 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,506 IT Pros & Developers. It's quick & easy.

Having trouble deleting a row using VBA query

P: n/a
Hi,

Can anyone tell me why my query doesn't work? I have a table called
ECO Main with columns ECO Number and ECO Revision. I can see the data
in my form, and I created a Delete Record button with the following
code in it. With this code, it says that it will delete 0 (zero)
records. In the first 2 lines, I read the values off the screen, which
works as verified by a break point.

I suspect that I just don't have the syntax quite right. I didn't
create the original database since I don't like to put spaces in table
or column names.

Also, should I execute any commands after this query. How about
displaying the previous record so the it looks to the user that the
last record just disappeared.

/Scott

strECO = Me.[ECO Number]
strECORev = Me.[ECO Revision]

SQLText = "Delete * FROM [ECO Main] WHERE ([ECO Main.ECO Number] =
'strECO' AND [ECO Main.ECO Revision] = 'strECORev');"

DoCmd.RunSQL SQLText
Mar 20 '08 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.