473,386 Members | 1,860 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Invalid use of ., ! or () - runtime error 3075

Hello All,

I'm in need of help here. I have build my query in a query builder in access as a select query. Query runs fine. Changed it to a make table query. Query makes table ok. Copy and pasted the SQL into my VBA on a form and bam! Run Time error 3075. I've checked and re-checked but I'm not any closer to finguring out where i'm off. If someone could help I would be so grateful! My full code is below. My error message states "Invalid use of '.', '!', or '()'. in query expression '((([SYSTEM WORKING].[ati hours]) ".... after the WHERE clause.

Expand|Select|Wrap|Line Numbers
  1. Private Sub btnStep15_Click()
  2.     ' make table query for Zones missing Fire ATI's
  3.     Dim SQL15 As String
  4.         SQL15 = "SELECT [SYSTEM WORKING].[ati hours], ZONE_WORKING.NOTES, ZONE_WORKING.NOTES_answers, ZONE_WORKING.DO_NOT_LOAD, " & _
  5.                     "ZONE_WORKING.cs_no, ZONE_WORKING.zone_id, ZONE_WORKING.event_id, ZONE_WORKING.descr, ZONE_WORKING.comment " & _
  6.                     "INTO [ZONES – WITH FIRE MISSING ATI] FROM [SITE WORKING] INNER JOIN (ZONE_WORKING INNER JOIN [SYSTEM WORKING] ON " & _
  7.                     "ZONE_WORKING.system_no = [SYSTEM WORKING].[system no]) ON [SITE WORKING].site_no = [SYSTEM WORKING].[site no] " & _
  8.                 "WHERE ((([SYSTEM WORKING].[ati hours]) Is Null) ((ZONE_WORKING.event_id) Not Like 'E*' AND (ZONE_WORKING.event_id) Not Like 'FA' " & _
  9.                     "AND (ZONE_WORKING.event_id) Not Like 'FB' AND (ZONE_WORKING.event_id) Not Like 'FH' AND (ZONE_WORKING.event_id) Not Like 'FI' " & _
  10.                     "AND (ZONE_WORKING.event_id) Not Like 'FJ' AND (ZONE_WORKING.event_id) Not Like 'FK' AND (ZONE_WORKING.event_id) Not Like 'FR' " & _
  11.                     "AND (ZONE_WORKING.event_id) Not Like 'FS' AND (ZONE_WORKING.event_id) Not Like 'FT' AND (ZONE_WORKING.event_id) Not Like 'FU'" & _
  12.                     "AND (ZONE_WORKING.event_id) Not Like 'FX' AND (ZONE_WORKING.event_id) Not Like 'FY') AND ((ZONE_WORKING.NOTES) Is Null) " & _
  13.                     "AND ((ZONE_WORKING.DO_NOT_LOAD) Is Null) AND (((ZONE_WORKING.descr) Like '*fire*' Or (ZONE_WORKING.descr) Like '*water*' " & _
  14.                     "Or (ZONE_WORKING.descr) Like '*smoke*' Or (ZONE_WORKING.descr) Like '*heat*') AND (ZONE_WORKING.descr) Not Like 'fire su*' " & _
  15.                     "AND (ZONE_WORKING.descr) Not Like 'fire tr*') AND ((ZONE_WORKING.comment) Is Null Or (ZONE_WORKING.comment) Not Like '*co*' " & _
  16.                     "AND (ZONE_WORKING.comment) Not Like '*tr*' AND (ZONE_WORKING.comment) Not Like '*su*')); "
  17.  
  18. Me.Message = "Copying..."
  19. Me.Repaint
  20.     DoCmd.RunSQL SQL15
  21. Me.Message = "Completed Step 15"
  22. Me.Repaint
  23.  
  24. End Sub
  25.  
Thanks in advance!
Apr 29 '09 #1
3 4635
ADezii
8,834 Expert 8TB
@timber910
Looks like you forgot an AND Clause in Line #8:
Expand|Select|Wrap|Line Numbers
  1.  "WHERE ((([SYSTEM WORKING].[ati hours]) Is Null) ((ZONE_WORKING.event_id) Not Like 'E*' AND (ZONE_WORKING.event_id) Not Like 'FA' " & _
Should Be:
Expand|Select|Wrap|Line Numbers
  1.  "WHERE ((([SYSTEM WORKING].[ati hours]) Is Null) And((ZONE_WORKING.event_id) Not Like 'E*' AND (ZONE_WORKING.event_id) Not Like 'FA' " & _
Apr 29 '09 #2
DAMN!! figures i just needed another set of eyes! Thanks for the help ADezii!!
Apr 29 '09 #3
ADezii
8,834 Expert 8TB
@timber910
Not a problem - some times another set of eyes is all that it takes (LOL)!
Apr 29 '09 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: JMCN | last post by:
I have an ftp program that i inherited and i tried to modify it to ftp over my file however, i receive an error message : run-time error '3075 syntax error (missing operator) in query expression...
2
by: Brad | last post by:
I have an intranet app that has just started sporadically getting the following error "The viewstate is invalid for this page and might be corrupted." By sproadic I mean 3-4 times during the past...
5
by: chrisstankevitz | last post by:
Hi, Q1: Is there a way to make a template function that works only for specific types which produces a compiler error if used with an invalid type? Q2: If not, how do people deal with this...
0
by: j.rogel | last post by:
Hello everyone! I am new to this sort of postings so I'm not even sure if this is the correct place to start. Anyway, I would realy appreciate any help. I have a some VBA code that works quite...
2
by: jr | last post by:
Hello everyone! I am new to this sort of postings so I'm not even sure if this is the correct place to start. Anyway, I would realy appreciate any help. I have a some VBA code that works quite...
25
by: dennijr | last post by:
ok, shell always used to be easy for me, now its starting to get annoying cause i dont know wats wrong heres the simplist code possible: Private Sub IExplorer_Click() a = Shell("C:\Program...
1
by: praveen7576 | last post by:
I get runtime error 3075 whichis followed by Syntax error(missing operator) in query espression while running this query: SqlStr = "SELECT FCLTY.FCLTY_N, FCLTY.ADDR_LINE_1, FCLTY.CITY_N,...
5
by: MARTINQC | last post by:
"SELECT ., .Category INTO tblSiteGroupActiveTicketRawData FROM .Base = 'AAAA') OR (.Base = 'BBBB')) AND (.Status != 'Closed');" Above SQL string fails with a runtime error 3075 syntax error...
3
by: adigga1 | last post by:
Hello Experts, I'm about to go grey with this dlookup statement: I'm trying to run a dlookup statement, I have the correct expression string, etc. but when I run it under the Immediate window...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.