Solved

Text Modify

Posted on 2014-07-30
6
195 Views
Last Modified: 2014-07-31
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"
0
Comment
Question by:DatabaseDek
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 120

Assisted Solution

by:Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1) earned 250 total points
ID: 40229613
here is one way to do this
if you have the info in text1
transfer it using

dim str

str=replace(me.text1.value,"S","")
0
 
LVL 37

Accepted Solution

by:
PatHartman earned 250 total points
ID: 40229751
I think the previous suggestion will remove all S's rather than just the final one.

If Right(YourField, 1) = "S" Then
    ResultField = Left(YourField, Len(YourField) -1)
Else
    ResultField = YourField
End If

Open in new window

0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 40229774
well, there is only ONE "S"
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 37

Expert Comment

by:PatHartman
ID: 40229796
I agree but -
but without the "S" on the end
Implies 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.
0
 
LVL 45

Expert Comment

by:aikimark
ID: 40230182
In the following example, replace the string literal "FD30S" with the name of the source control/field.
target = StrReverse(Replace(StrReverse("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
0
 

Author Closing Comment

by:DatabaseDek
ID: 40231275
One accurately answered my question the other gave a better answer than required.

Great

Thank you both
0

Featured Post

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question