Solved Runtime error '3061' too few parameters .expected 1

no, Unfortunately . I have to run my project and stuck to this little part ...
To try it, copy and paste the code/function from the website into a Standard Module and give the module a generic name like Module1.

Then, modify your code to replace this line:

Code:
CurrentDb.Execute sVal

With this one:

Code:
fExecuteQuery sVal

Hope that helps...
 
Did you try the Debug.Print method? If so, what's the SQL of the failing query? You don't by chance have spaces in table names do you? If so you'll need to surround the table name in square brackets.:

"FROM [" & sVal & "]"
Yes you are right........ bracket helped ....
the code is working now .. but I don't know how !!!
I tried to test it by append query and it added a bracket for table name in SQL code !!!


I appropriate all your help and advice ...i have to study more how to debug VBA codes ....
 
Yes, the query design grid will add them automatically, but you have to do it yourself in code. Glad you got it working.
 
Did you try the Debug.Print method? If so, what's the SQL of the failing query? You don't by chance have spaces in table names do you? If so you'll need to surround the table name in square brackets.:

"FROM [" & sVal & "]"
I really appropriate that.... yes you were right,I saw that ,Access adds a [ ] for table name in the append query sql ..

my problem solve till here .
thank you very much for all helps .I have to study more about VBA debugging..
 

Users who are viewing this thread

Back
Top Bottom