Solved

DE Report

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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…

777 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