Hi to everyone,
I have the following problem which is producing the following error:
Syntax error (missing operator) in query expression '(CourseNo = CN1863)
This caused from the follOwing being run from a command button on a form. The sync is between the form (Combo box ) and a report (txt field).
DoCmd.OpenReport "RptValidationMainP3_Course1863", acPrintPreview, , "CourseNo = " & Me.CourseNo
The report is based on a table which has many 'CourseNo's', and I want the chosen value from the form combo to filter the records to be printed in the report. i.e select CourseNo '1863' via the combo box on the form (with other fields input by the user) and then clicking the command button opens the report filtered to the combo box value.
My apologies if i've been a bit long winded describing this, and hope that there is enough here to show my problem.
Any assistance would be really appreciated.
My Thanks
Dave
6 16640
...I have the following problem which is producing the following error:
Syntax error (missing operator) in query expression '(CourseNo = CN1863)
...
DoCmd.OpenReport "RptValidationMainP3_Course1863", acPrintPreview, , "CourseNo = " & Me.CourseNo
Hi Dave. This problem crops up fairly frequently in referring to string values, and arises because you are missing two quote marks from the filter statement. This should be: - DoCmd.OpenReport "RptValidationMainP3_Course1863", acPrintPreview, , "CourseNo = '" & Me.CourseNo & "'"
Without the quote marks Access is trying to interpret the course name as a field name or operator, without success.
Add the quote marks in as shown and the DoCmd should be OK.
-Stewart
Hi Dave. This problem crops up fairly frequently in referring to string values, and arises because you are missing two quote marks from the filter statement. This should be: - DoCmd.OpenReport "RptValidationMainP3_Course1863", acPrintPreview, , "CourseNo = '" & Me.CourseNo & "'"
Without the quote marks Access is trying to interpret the course name as a field name or operator, without success.
Add the quote marks in as shown and the DoCmd should be OK.
-Stewart
Hi Stewart,
Works a treat!. This is one thing i will pop in my good gen folder. Many many thanks, and I am smiling like a 3 year old kid!!
with best wishes, Dave
Hi Stewart,
Works a treat!. This is one thing i will pop in my good gen folder. Many many thanks, and I am smiling like a 3 year old kid!!
with best wishes, Dave
Very glad to have been able to help, Dave.
Regards
Stewart
I was running into this same problem and it turned out that I was missing the quotation marks as susggested. This got me past that hurdle however I know have a new problem.
Now when I go to open the report I am present with a message box asking me to input the value that is referenced in the filter.
Anyone with ideas?
Hi jghouse. We'd need to know a bit more about your problem before we can answer it, and as it really does not relate to this particular thread it would be better to start a new discussion thread for your current difficulty.
If you could please do so, posting the code that is used to open your report, it would be much appreciated.
Thanks
Stewart
...Now when I go to open the report I am present with a message box asking me to input the value that is referenced in the filter.
Hi jghouse. We'd need to know a bit more about your problem before we can answer it, and as it really does not relate to this particular thread it would be better to start a new discussion thread for your current difficulty.
If you could please do so, posting the code that is used to open your report, it would be much appreciated.
Thanks
Stewart
Stewart,
Thanks to your attention on this. After a night away from it I realized an unbelievably stupid error. My issue is not fixed but this thread was helpful in oslving my original one. Thanks again for all you do.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: shank |
last post by:
1) I'm getting this error: Syntax error (missing operator) in query
expression on the below statement. Can I get some advice.
2) I searched ASPFAQ and came up blank. Where can find the "rules"...
|
by: dcarson |
last post by:
I've read about this error in several other discussions, but still
can't seem to pinpoint the problem with my code. Everything seemed to
be working fine for some time, but it now tends to bomb out...
|
by: Alan Murrell |
last post by:
Hello,
One of our web hosting clients is getting the following error when
someone tried to log in form their login page:
--- ODBC ERROR ---
Microsoft OLE DB Provider for ODBC Drivers error...
|
by: chug |
last post by:
I'm not a programmer but it's my job to solve this. Can someone help me
with this error message?
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
Syntax error (missing
operator)...
|
by: Tog |
last post by:
Hello,
I have read several posts with this heading but none of them have helped.
I have the following error message:
Syntax error (missing operator) in query expression 'left(Your Product...
|
by: access baby |
last post by:
I hava a date parameter filter query but it shows error Syntax error
missing operator in query experssion
can some one please help where am i going wrong in expression
SELECT copyorderdtl * ...
|
by: nerd4access |
last post by:
Hello all! I am not new to access, but new to coding (and posting). I have a database that I have created and need some help with a login form. When a user opens the database, a form pops up...
|
by: aaron6098 |
last post by:
I am trying to finish my final project for my programing class. i keep on getting Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
Syntax error (missing operator) in query...
|
by: munkee |
last post by:
I am trying to dynamically update the rowsource of a chart within access.
To achieve this I moved the original rowsource sql of the chart which is:
SELECT tblParetoRaising.NCType,...
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
| | |