Removing characters off of front of field

T

Tim

I have a form field setup so that when a user tabs into
that field, it automatically adds a date stamp and the
persons name before the text that they are about to type.


I want to display the information from that field on a
report, but I need it to display without the timestamp or
person's name. Is there a way to display all text after
a certain character or point that is in the field.

Any help would be appreciated.
 
J

jmonty

Sounds to me like you could use the InStr function to find
the loction of your certain character, then use the
Left(), Right(), or Mid() functions to extract the desired
string.

See Access help on how to use these functions.

Example:
strMyString = "12345-abcde"
strSubstring = Mid(strMyString,InStr(strMyString,"-"))

'strSubString = "abcde"
 
S

SA

Tim:

Look up Instr() and Right() functions in the help file.

strVar = ("1234rf904$Sam Steed")
Right(strVar, Len(strVar) - Instr(strVar,"$")) = Sam Steed
 
D

Duane Hookom

Do you have some consistency in the date and name combination? For instance
if there are a specific number of spaces prior to the text you want to
display, then you can write some code or an expression that "discards" the
first part of the text.
 

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