Solved

With within If

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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
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…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

705 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

17 Experts available now in Live!

Get 1:1 Help Now