Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

DE Report

Posted on 2002-05-31
2
Medium Priority
?
195 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 200 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

670 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