Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

DE Report

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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

877 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