Removing characters off of front of field

  • Thread starter Thread starter Tim
  • Start date Start date
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.
 
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"
 
Tim:

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

strVar = ("1234rf904$Sam Steed")
Right(strVar, Len(strVar) - Instr(strVar,"$")) = Sam Steed
 
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.
 
Back
Top