Solved

With within If

Posted on 2011-02-25
2
233 Views
Last Modified: 2012-05-11
is there an syntax issue with the foll:

if col1 like "%.txt" then
with ds
.Addnew
......
.Update
End with
End if

without the if and end if, the statement works fine, but with the "if" module attached, the update does not happen. the col1 value is something "first.txt"

thanks
0
Comment
Question by:anushahanna
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 8

Accepted Solution

by:
crysallus earned 500 total points
ID: 34985690
Looks to me like you've got the wrong  character in your if condition. Is the '%', which as far as I'm aware isn't a special character and only matches a literal %, meant to be a '*' to match zero or more characters?

What you are testing for here is whether col1 literally matches %.txt, which is false, which is why the code isn't executing. It should be "*.txt" instead.

Read this for more:

http://msdn.microsoft.com/en-us/library/swf8kaxw.aspx#Y1482
0
 
LVL 6

Author Comment

by:anushahanna
ID: 34985700
helped - thanks crysallus.
0

Featured Post

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

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.
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
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…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

751 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