Solved

DE Report

Posted on 2002-05-31
2
194 Views
Last Modified: 2010-05-02
Hi,

I have a DE named myDe and a Data Report page named myRpt.  In my DE, i have a command named cmdTable which points directly to table named myTable.  In myRpt page, for DataSource, i connect it to myDe, and for DataMember, i have it connect to cmdTable.
On one of the form, i have a textbox named myText and a button named btnSubmit.  The function for the btnSubmit is:
Private Sub btnSubmit_Click()
  myDe.rscmdTable.Open "SELECT * FROM myTable WHERE myID = '" & myText & "';"
  myRpt.Show vbModal
  myDe.rscmdTable.Close
End Sub

When i execute this file, i got an error message:
"Run-time error '=2147217904 (80040e10)';
[Microsoft][ODBC Microsoft Access Driver] Too few parameters.  Expected 1."

What is going on?

I also tried:
myDe.Commands("cmdTable").CommandText = "SELECT * FROM myTable WHERE myID = '" & myText & "';"
myDe.Commands("cmdTable").Execute
myRpt.Show vbModal

This gave me an error:
"Run-time error '-2147217900 (50040e14)';
[Microsoft][ODBC Microsoft Access Driver] Syntax error in FROM clause.

What have i done wrong?  Please help
TommyN14
0
Comment
Question by:TommyN14
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 2

Accepted Solution

by:
ventond earned 50 total points
ID: 7048272
As far as I can tell your field myID cannot be found on the table myTable. So access thinks it is a parameter. That is how I managed to force this error.
btw I used your first example.
0
 
LVL 1

Author Comment

by:TommyN14
ID: 7048358
I got it.  Thanks!  That's suck.  I thought i check it.  Turned out, there is a space in between myID.

Have a great weekend!
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month2 days, 18 hours left to enroll

622 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question