Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old June 20th, 2005, 01:45 PM
Authorized User
 
Join Date: Feb 2004
Location: , , Canada.
Posts: 55
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to chacquard
Default Too few parameters. 1 expected !!!

I am trying to run an SQL Query in VB access but I keep on getting this message -- Too few parameters. 1 expected. I tested the SQL in a query and it works fine. What is it I am missing ? Can anyone help me please.

Chantal
Reply With Quote
  #2 (permalink)  
Old June 20th, 2005, 03:22 PM
Friend of Wrox
Points: 4,007, Level: 26
Points: 4,007, Level: 26 Points: 4,007, Level: 26 Points: 4,007, Level: 26
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Lansing, Michigan, USA.
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
Send a message via ICQ to SerranoG Send a message via AIM to SerranoG
Default

Please post your SQL so we can read it.

Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division
Reply With Quote
  #3 (permalink)  
Old June 21st, 2005, 08:00 AM
Friend of Wrox
 
Join Date: Nov 2004
Location: Seattle, WA, .
Posts: 248
Thanks: 0
Thanked 1 Time in 1 Post
Default

I recommend you set up your VB code something like this:

SQL = the sql statement
Debug.Print SQL
DoCmd.RunSQL SQL

The Immediate Window will have the exact SQL statement that is executed. If you can copy the SQL from the Immediate Window into a query and run that successfully, there is something really, really wrong. My bet is that the sql statement that you think you're running in VB isn't the same as the one you tested in a query.

Primarily, your problem is likely to be that the sql statement has quotes in it and in VB you'll have to double-up or triple-up the quotes to get the correct SQL syntax.

Randall J Weers
Membership Vice President
Pacific NorthWest Access Developers Group
http://www.pnwadg.org
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
update stt- Too few parameters. Expected 1. s_sanks Classic ASP Databases 0 March 7th, 2008 08:03 AM
too few parameters expected 1 jim11 Access VBA 1 December 7th, 2005 03:41 PM
too few parameters expected n desprate Access VBA 6 April 29th, 2005 06:33 AM
Error "Too Few Parameters - Expected 1" timmaher Access VBA 2 August 31st, 2004 04:04 AM
Too few parameters. Expected 1. harry_barry Classic ASP Databases 2 May 26th, 2004 04:12 PM



All times are GMT -4. The time now is 02:12 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.