Syntax error - question on form?????

G

Guest

I am using article KB208529, which has worked in other databases of mine, to
set up a report filter from a pop-up form. When I choose a value from a
combo box, then click "set filter", I get the following error:

Syntax error (missing operator) in query expression '([Provider
Type]="Physician" A).'

Originally, the source for the report was a crosstab query, but I have since
changed it to a select query (built from the crosstab) to see if that made a
difference, but it didn't.

Please help - I can't find any solutions to this!

Thanks,
Susan
slegg @ earthlink.net
 
D

dcichelli

From looking at your syntax error, the query that filters the records
does not have the correct syntax. The problem is after the = sign.
Unless you have a typo in your posting, the 'A' should be inside the
double quotes. Otherwise, Access tries to evaluate the 'A' separate
from 'Physician' with no luck.

In order for us to help you fix this, please post the VB you are using
for the "set filter" button's onclick property (if the module calls a
query, then also post the SQL for that query).
 
G

Guest

Thank you for responding. I hope you can help. Here is the VB for the Set
Filter:

Private Sub Set_Filter_Click()
Dim strSQL As String, intCounter As Integer

' Build SQL String.
For intCounter = 1 To 4
If Me("Filter" & intCounter) <> "" Then

strSQL = strSQL & "[" & Me("Filter" & intCounter).Tag & "] " _
& " = " & Chr(34) & Me("Filter" & intCounter) & Chr(34) & _
" And "
End If
Next

If strSQL <> "" Then
' Strip Last " And ".
strSQL = Left(strSQL, (Len(strSQL) - 4))

' Set the Filter property.
Reports![Report 1A - Adjusted Utilization].Filter = strSQL
Reports![Report 1A - Adjusted Utilization].FilterOn = True
End If
End Sub


And here is the Row Source for the combo box:

SELECT DISTINCT [FINAL Query 1A].[Provider Type] FROM [FINAL Query 1A] ORDER
BY [FINAL Query 1A].[Provider Type];

Thanks,
Susan



From looking at your syntax error, the query that filters the records
does not have the correct syntax. The problem is after the = sign.
Unless you have a typo in your posting, the 'A' should be inside the
double quotes. Otherwise, Access tries to evaluate the 'A' separate
from 'Physician' with no luck.

In order for us to help you fix this, please post the VB you are using
for the "set filter" button's onclick property (if the module calls a
query, then also post the SQL for that query).


Susan said:
I am using article KB208529, which has worked in other databases of mine, to
set up a report filter from a pop-up form. When I choose a value from a
combo box, then click "set filter", I get the following error:

Syntax error (missing operator) in query expression '([Provider
Type]="Physician" A).'

Originally, the source for the report was a crosstab query, but I have since
changed it to a select query (built from the crosstab) to see if that made a
difference, but it didn't.

Please help - I can't find any solutions to this!

Thanks,
Susan
slegg @ earthlink.net
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top