|
-
Sep 6th, 2000, 06:26 PM
#1
Thread Starter
Lively Member
Dim My_Query As String
My_Query = cbosearch & " " & Cbo_Operator & " " & txtsearch.Text & "'"
Data1.RecordSource = "SELECT * FROM General WHERE " & My_Query
Data1.Refresh
Data1.Recordset.MoveLast: Data1.Recordset.MoveFirst
MsgBox Data1.Recordset.RecordCount & " matches found."
Exit Sub
Does anyone see a syntax error?
-
Sep 6th, 2000, 06:52 PM
#2
Lively Member
error
What is the error you are getting?
-
Sep 6th, 2000, 08:04 PM
#3
Thread Starter
Lively Member
Error 3022 Syntax error in from statement.
-
Sep 6th, 2000, 08:31 PM
#4
Lively Member
error
What is the value of each of these when you get the error?
cbosearch
Cbo_Operator
txtsearch.Text
-
Sep 7th, 2000, 01:56 PM
#5
Thread Starter
Lively Member
cbosearch is the name of a databse field like - Name and txt search is the name you are searching for the other combo box I deleted but set the value to Like.
-
Sep 7th, 2000, 02:08 PM
#6
Lively Member
It looks like you don't have your other single quote in from the the txtSearch.Text. You should have this and only this for alpa fields. If it is numeric take out the single quotes around txtSearch.text
My_Query = cbosearch & " " & Cbo_Operator & " '" & txtsearch.Text & "'"
-
Sep 7th, 2000, 02:09 PM
#7
Lively Member
I said from txtSearch.text, what I meant was in Front of txtSearch.text you need the other single quote
-
Sep 7th, 2000, 03:00 PM
#8
Thread Starter
Lively Member
It is still giving the same error. I am just trying to search my database for a name or number from a textbox and display the results of the whole row in other textboxes.
-
Sep 8th, 2000, 06:15 PM
#9
Fanatic Member
Try this
Dim My_Query As String
'You missed out this (')
My_Query = cbosearch & " " & Cbo_Operator & " '" & txtsearch.Text & "'"
Data1.RecordSource = "SELECT * FROM General WHERE " & My_Query
Data1.Refresh
Data1.Recordset.MoveLast: Data1.Recordset.MoveFirst
MsgBox Data1.Recordset.RecordCount & " matches found."
Exit Sub
You missed out (') in your code
Hope this helps
Spud
-
Sep 8th, 2000, 08:10 PM
#10
Thread Starter
Lively Member
It still gives me the error but i think something else somewhere else in the code is causing the error, not the actual search part. But there are to many lines to post all the code.
[Edited by chongo 2002 on 09-08-2000 at 09:27 PM]
-
Sep 19th, 2000, 09:21 PM
#11
Thread Starter
Lively Member
The General needs to be [General] for anyone who has this same problem.
-
Sep 19th, 2000, 09:55 PM
#12
Member
You are missing something...
Try:
Data1.RecordSource = "SELECT * FROM General WHERE Myfield = " & My_Query
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|