Solved

What is the correct syntax?

Posted on 2011-09-11
6
218 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-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
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…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …

920 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now