Solved

With within If

Posted on 2011-02-25
2
231 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
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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying 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

I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
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 …
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

828 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