Missing operator in query expression

Prysson

Registered User.
Local time
Today, 21:34
Joined
Sep 23, 2002
Messages
45
Hello....

I seem to be missing an 'operator' in my expression and I am slightly confiused as to what that might be.

The query statement is:

SELECT qListTrainingSystems.[Training System] FROM qListTrainingSystems WHERE (((qListTrainingSystems.[Training System])<>"na")) ORDER BY qListTrainingSystems.[Training System];

This query is used to determine the contents of a list box.

A pop up form uses the following filter in the properties to pass the record selected into the text field

[Training System]=''


The problem occurs when A record is added that has an apostrophe in its value (such as John's)

The record will add fine but when I try to select that record with the above mentioned filter I get an error saying that

Syntax error (missing operator) in query expression '[TrainingSystem]='John's''


It seems pretty apparent to me that the problem is the apostrophe that confuses the query but I am not really sure how I can resolve that problem.

Any Help?
 
I am still having problems...

Here is the scoop.

frmEditTrainingSystem has a pop up window frmEditTrainingPopUp

the on clikc code has a wherecondition that determines the filter for the frmEditTrainingPopUp.

The code looks like this

Private Sub cmdEditTrainSystems_Click()
On Error GoTo Err_cmdEditTrainSystems_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "frmEditTrainingPopUp"

stLinkCriteria = "[Training System]=" & "'" & Me![ListTrainingSource] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_cmdEditTrainSystems_Click:
Exit Sub

Err_cmdEditTrainSystems_Click:
MsgBox Err.Description
Resume Exit_cmdEditTrainSystems_Click

End Sub



This passes the filter to the frmEditTrainingPopUp

but it by default places it in the [Training System]='' format

How would I change the code fromt he on click in the wherecondition to allow for the ' in teh name.

I am just not seeing it.
 
Never Mind I figured it out..

I needed to put two double quotes inside the double quotes and I was only putting one.


Thanks for the help I appreciate it.

:)
 
I am glad you got it squared away. Continued success with Access...

Jack
 

Users who are viewing this thread

Back
Top Bottom