Solved

With within If

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

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

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

Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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 …

627 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