Solved

DE Report

Posted on 2002-05-31
2
183 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
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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
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…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

747 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now