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

How to Update Query using Total Count

P: 15
I have two tables.. I want to update one table with the count of each colume from the pervious table. I have been able to do it using the query bulider and when ran, it works but I want to take the SQL statment and copy it into my moduel however it won't work. It will not let me format the SQL statment and remove put the whole statement on one line. I'm new at this so I don't really understand why I am unable to do this. Below is the code I have. I also have done this with other update querys that I didn't count, just simply copied from one table to another and that worked fine.

I use db.execture "the sql stament" because the query is so long it copies it one two lines and when I try and make it all one one line it doesn't work. Its at the point where its (SELECT COUNT(BlockRegenTemp From BLOCKNUM) AS CountOfBLOCKNUM.


Thanks
Jul 7 '10 #1
Share this Question
Share on Google+
4 Replies


NeoPa
Expert Mod 15k+
P: 31,768
Dawn, please try to explain this using code (in CODE tags) that is copy pasted. Typos in code are unnecessary and can waste much time and effort.

By the way, I'm pretty confident we can help once we have a clearer understanding of the question.

Welcome to Bytes!
Jul 7 '10 #2

nico5038
Expert 2.5K+
P: 3,072
When you have a working query, just execute this like:

Expand|Select|Wrap|Line Numbers
  1. CurrentDb.Execute ("Your_qryUpdate_Name")
  2.  
Nic;o)
Jul 7 '10 #3

P: 15
Thanks for your reply! Thats what I used and it worked. But I also figured out why it would't work the other way in the first place.. Pretty simple and stupid of me but I have never had it happen before so I did learned from it. It was that my query was to long for one line.. I got it working now so thats what matters! Thanks again for all the help! :)
Jul 8 '10 #4

NeoPa
Expert Mod 15k+
P: 31,768
That's all good then. Well done :)
Jul 8 '10 #5

Post your reply

Sign in to post your reply or Sign up for a free account.