Solved

What is the correct syntax?

Posted on 2011-09-11
6
233 Views
Last Modified: 2012-05-12
    If fld.Name Not Like "Report*'" And fld.Name Not Like "Lvl*" And fld.Name Not Like "PRV*" And fld.Name Not Like "CURR*" Then


I am getting a syntax error in VBA

Thanks
0
Comment
Question by:kosenrufu
  • 4
6 Comments
 
LVL 75

Expert Comment

by:käµfm³d 👽
ID: 36520134
It looks like you've got an extra single quote in "Report*'". You can probably see it better below:
If fld.Name Not Like "Report*'" And fld.Name Not Like "Lvl*" And fld.Name Not Like "PRV*" And fld.Name Not Like "CURR*" Then

Open in new window

0
 

Author Comment

by:kosenrufu
ID: 36520158
I narrowed down the syntax to If fld.Name Not Like "Report*" Then

and still does not work
0
 

Author Comment

by:kosenrufu
ID: 36520163
It's

                If fld.Name Like Not "Report*" And fld.Name Like Not "Lvl*" And fld.Name Like Not "PRV*" And fld.Name Like Not "CURR*" Then

Like Not

But now I get a type mismatch when i run the script
0
Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

 

Accepted Solution

by:
kosenrufu earned 0 total points
ID: 36520172
I fixed it

It's If Not fld.Name Like "Report*" And Not fld.Name Like "Lvl*" And Not fld.Name Like "PRV*" And Not fld.Name Like "CURR*" Then
0
 
LVL 45

Expert Comment

by:aikimark
ID: 36520450
Is there an End If statement?
0
 

Author Closing Comment

by:kosenrufu
ID: 36991215
figured out
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question