truncate left characters

G

Guest

I am using access 2003 on windows xp. I have a form, "frmSearch" with
controls whose values I use as the critera for a report. One control,
"strSearchBy", selects which field to search, the other control,
"strCriteria" is for the search criteria. The "submit" button passes these
fields to an sql string that I then pass into a report. On the report, I
have a field in the header that refers back to
[Forms]![frmSearch].[strSearchBy]. The problem is that it is returning the
field names with my naming conventions on them, i.e. strAuthor, strTitle,
strSubject. Is there a way to take off the three leftmost characters in a
string? To throw another kink in the problem, one of the seach criteria is
simply "keyword", which searches all three fields. If there is a way to take
off the left three characters, I would not want it to do that if "keyword" is
in the "strSearchBy" box. Any help would be appreciated.
 
G

Guest

You have to options
1. Remove the str from the name, can be tricky if you have str somewhere
else in the name

Replace([FieldName],"str","")

2. Or, use the mid function
Mid([FieldName],4)

So the name will start from the forth chr
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top