Derek Brown
asked on
Text Modify
I have a field on form "A" with can have any of the following values
FD30, FD30S, None, FD60, FD60S, FD120 and FD120S
I want to get any one of these values and auto enter it into another none related form but without the "S" on the end leaving any of the following.
FD30, None, FD60, and FD120
In other words get the value from form "A" strip off the "S" and paste into Form "B". I have the transfer it's just getting rid of the "S"
FD30, FD30S, None, FD60, FD60S, FD120 and FD120S
I want to get any one of these values and auto enter it into another none related form but without the "S" on the end leaving any of the following.
FD30, None, FD60, and FD120
In other words get the value from form "A" strip off the "S" and paste into Form "B". I have the transfer it's just getting rid of the "S"
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
well, there is only ONE "S"
I agree but -
but without the "S" on the endImplies the "S" means something on the end that it doesn't mean somewhere else in the code. We may be seeing the complete code list so in that case taking out any "S" would work but if a new pair of codes gets added and they have an embedded "S", stripping only the ending "S" would be preferable.
In the following example, replace the string literal "FD30S" with the name of the source control/field.
target = StrReverse(Replace(StrReve rse("FD30S "),"S", vbNullString,1,1))
In this case, target depends on the context/method of the data move. If assigning a value in VBA code, it will likely be the control.value property. If assigning in an update or insert query, it will be the name of the field receiving the data
target = StrReverse(Replace(StrReve
In this case, target depends on the context/method of the data move. If assigning a value in VBA code, it will likely be the control.value property. If assigning in an update or insert query, it will be the name of the field receiving the data
ASKER
One accurately answered my question the other gave a better answer than required.
Great
Thank you both
Great
Thank you both