Help: Select Query Problems 
Author Message
 Help: Select Query Problems

Please excuse my ignorance, I am new to database programming in VB. I keep
getting this  error message "Run-time error 3061: Too few paremeters.
Expected 1" whenever I try to use a select query like the one below. Could
someone please explain:

Data1 is linked to a db containing one table called tblPostCodes.
tblPostCodes contains three fields: Suburb, State, & PostCode.
DBGrid1 is a db grid linked to Data1.
txtSelect is a textbox on the form.

        Data1.RecordSource = ("SELECT Suburb, State, PostCode FROM
tblPostCodes WHERE Suburb =  " & txtSelect.Text)
        Data1.Refresh
        DBGrid1.ReBind



Wed, 23 May 2001 03:00:00 GMT  
 Help: Select Query Problems
Have you placed single inverted commas at the begining and end of your
string?

eg

"SELECT * FROM CUSTOMERS WHERE SURNAME = ' SMITH ' "

Quote:

>Please excuse my ignorance, I am new to database programming in VB. I keep
>getting this  error message "Run-time error 3061: Too few paremeters.
>Expected 1" whenever I try to use a select query like the one below. Could
>someone please explain:

>Data1 is linked to a db containing one table called tblPostCodes.
>tblPostCodes contains three fields: Suburb, State, & PostCode.
>DBGrid1 is a db grid linked to Data1.
>txtSelect is a textbox on the form.

>        Data1.RecordSource = ("SELECT Suburb, State, PostCode FROM
>tblPostCodes WHERE Suburb =  " & txtSelect.Text)
>        Data1.Refresh
>        DBGrid1.ReBind



Wed, 23 May 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Problem Passing parameters to select query

2. Select Query Problem

3. Problem with Memo field in SELECT DISTINCT queries

4. Selecting from a Parameterised query in a CreateQuerydef'd query

5. Getting a resultset from a SELECT query embedded in another query

6. SELECT queries - Use Access query or not?

7. Help with this select query please; Access 2002

8. Help with Select Query Statement!!!

9. cannot run SELECT QUERY - help

10. Help!! Auto Email to query selected addresses

11. Help: SELECT CASE query in ACCESS

12. Can anyone help with Select Query and VB?

 

 
Powered by phpBB® Forum Software