|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here! |
|
#1
|
|||
|
|||
|
Easy Syntax problem ?!
WHERE (((Participants.Event)= Form8.Text1.Text'));"
What is the correct syntax for using a Textbox Text to denote the WHERE parameter. I have tried many different ways and none work. THX |
|
#2
|
|||
|
|||
|
well first of all...what language are you using?
and usally it's like this : Querystr:= Querystr+WHERE (((Participants.Event)= "+Form8.Text1.Text+")); I assumed that Participants is the table and Event is a field |
|
#3
|
|||
|
|||
|
Using Access 2000 and VB6
Correct, Participant is the Table Event is the field The query is in a ADODC control on the form the Textbox ison. THX |
|
#4
|
|||
|
|||
|
Getting closer
I used your string at the end of my query but I am not sure if I should have used all of your string.
Here is my full query string together with your string "SELECT Participants.Event, Participants.Full_Name, Participants.Phone_Number From Participants WHERE (((Participants.Event)= " + Form8.Text1.Text + "));" I got the column headers in the DataGrid bound to the ADODC control but no data even when I have the correct event field value in the textbox. THX |
|
#5
|
|||
|
|||
|
are you using Access2000 or SQL?
I don't know if I wrote this or not..but try without the Form8.text1.text thing. so you query should look like this: "SELECT Participants.Event, Participants.Full_Name, Participants.Phone_Number From Participants WHERE (Participants.Event=2);" //2 or whatever value you know will bring data. if Event is some text make sure you do a ' before and after you text, like this ...event='holiday'); btw I think you may have to much parentheses or something...I don't remember VB6 all that well. |
|
#6
|
|||
|
|||
|
Thanks
I had help on this site to create the query and it does work if I explictly place a value in the WHERE Clause, I tested it first with a hardcoded value. The problem is I have a list of names and each one has an event, I need to group all the events with the names and this query will do that but I will have many names and many different events in the future and I need to do this on a VB form dynamically for each different event. When moving to each event on the form, it shows all names that have that particular event listed with their record. THX Last edited by BratCat2 : March 1st, 2004 at 07:35 PM. Reason: Forgot some info |
![]() |
| Viewing: Dev Shed Forums > Databases > MS SQL Development > Easy Syntax problem ?! |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|