Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

InStr Detect "|" Problem 1

Status
Not open for further replies.

evalesthy

Programmer
Oct 27, 2000
513
0
0
US
I have a text field that ultimately gets exported to another application. If the User enters 3 consecutive periods "..." Access autocorrect turns them into what appears to be a vertical pipe "|". I need to trap for the occurence of "..." or "|" but have not been successful using InStr. I tried looking for those values and also tried looking for the ascii value with no success. Note, the InStr function does work if looking for 'a' or 'A' as a text value or as ascii value so that is not the problem.

I do not want to change autocorrect as end user may undo that setting.

Any ideas?
 
Hmmm... I've never noticed this feature before. I've just created a quick test and the bound form does display what appears to be a pipe character, but it isn't.

The ASCII value of the form control is 133 (pipe is 124), however when I checked the value stored in the table it was still "...".

Depending on whether you check the form's control value or the table's field you should be able to use one of the following:

instr(1,forms!formname!controlname.value,chr(133))

or

instr(1,TableValueFromSomewhere,"...")

Ed Metcalfe.

Please do not feed the trolls.....
 
Thanks - ASCII 133 worked perfectly. As I mentioned I did not want to change settings in AutoCorrect as someone can change them back.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top