Solved

With within If

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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

Suggested Solutions

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…
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…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

832 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