Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error When Running A Macro 1

Status
Not open for further replies.

kc27

Technical User
Sep 10, 2008
171
0
0
US
When I run a macro on an Access database (using Access 2013), I get the following error:

Run-time error '3061'
Too few parameters. Expected 1.

It then highlights the line of code shown in this link.

Further complicating this issue is that I am not a programmer, and am not familiar with the tables or data contained therein. The macro is supposed to be run on a weekly basis. One week ago, the macro ran without failing. This week it failed. From the way the error reads, it seems as though the the syntax in the macro is not correct. The macro has not been edited since the time is successfully ran. How could it work one week, and then fail the following week?

Any advice on how to troubleshoot this would be appreciated.




 
Taking a step back was useful. Today, I re-read our conversation from the top, and I believe I finally understood what you were saying in your post on Sep 16 14:40

After I made the edits that you had outlined in that post, below is what happened when I ran the macro:

This run time error appeared
01_run_time_error_grlfp9.gif


This was the debug screen. The text in the immediate window reads: SELECT Dept, P0917 FROM SalesF ORDER by Dept
02_debub_screen_tigxg0.gif


Here is the SalesF table. The Dept values range from p0107 to p0717

Am I interpreting the Immediate window results: SELECT Dept, P0917 FROM SalesF ORDER by Dept, to mean that the macro is looking for a Dept value of p0917 that is not there?

03_salesf_table_s0wgar.gif
 
P0917 is a Field name not a Dept.

Where is field P0917 in your design view?

BTW, your table design seems to be terrible! You ought never to have field names that ate data values as P0917 seems to be along with all those other field names beginning with P. Uuuuuugly! Horrible to analyze.

Skip,
[sub]
[glasses]Just traded in my OLD subtlety...
for a NUance![tongue][/sub]
 
Below is what the top half of the table looks like in Design View. I added P0817 and P0917 to the table after I took the earlier screen shot in the post above. Once P0917 was added, the macro then ran successfully. Thanks for all your help. Sorry I misread the directions that you gave very early on in this thread. It would have saved a lot of time and effort. And again, I really appreciate you sharing your time and expertise.

04_salesf_table_top_tk4pai.gif
 
Why do you have all those field names that look as if they are date related? You're really shooting yourself in the foot with that kind of design. Maybe you aren't the one who did design it. But that design makes analysis and reporting very VERY clumsy.

Skip,
[sub]
[glasses]Just traded in my OLD subtlety...
for a NUance![tongue][/sub]
 
The design was not mine. I am not a programmer/developer. These Access tables do read and send data from/to other non-Access databases. The developers of the Access tables and related applications, who are no longer with the company, may have been mirroring the table design of the other non-Access tables. It was mentioned that the Access tables would need some date and week record maintenance to keep them in sync with the non-Access tables, but the SalesF table was never mentioned as one of those tables. Since P0917 is what the macro was expecting to find, I went ahead and added it, and it seemed to resolve the problem.

At some point something will come up that will require an Access developer, hopefully my company will have someone on board with those skills by then.
 
Okay. Good luck. Glad you got this sorted out.

Skip,
[sub]
[glasses]Just traded in my OLD subtlety...
for a NUance![tongue][/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top