Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6024569
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T04:10:29+00:00 2026-05-23T04:10:29+00:00

I created this function to remove vbCrLf from the values of properties in a

  • 0

I created this function to remove vbCrLf from the values of properties in a Custom Class:(vTransaction)

Public Function ValidateTransaction(ByRef vTransaction)            
        Dim property1 As String
        Dim value1 As String

        For Each p As System.Reflection.PropertyInfo In vTransaction.GetType().GetProperties()
            If p.CanRead Then
                property1 = p.Name '// FOR TESTING to identify Property Name
                value1 = p.GetValue(vTransaction, Nothing)
                If (TypeOf value1 Is String) Then
                    If value1 <> " " And value1 <> "" Then
                        'MsgBox("Before .Replace:" & vbNewLine & value1.ToString) '// FOR TESTING.
                        value1 = value1.ToString.Replace(vbCrLf, " ")
                        'MsgBox("After .Replace:" & vbNewLine & value1.ToString) '// FOR TESTING.
                    End If
                End If
            End If
        Next

        Return vTransaction

    End Function

Throughout testing I can verify that vbCrLf is being replaced with a space as expected. When I re-examine vTransaction the changes have not been retained and the vbCrlf’s are still there.

What do I need to do to retain the changes being made to values in vTransaction.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T04:10:30+00:00Added an answer on May 23, 2026 at 4:10 am

    You are not setting the property value again. You are just creating a string that is not used after that. Your innermost If-block should be something like this:

    If value1 <> " " And value1 <> "" Then
        'MsgBox("Before .Replace:" & vbNewLine & value1.ToString) '// FOR TESTING.
        p.SetValue(vTransaction, value1.ToString.Replace(vbCrLf, " "), Nothing)
        'MsgBox("After .Replace:" & vbNewLine & value1.ToString) '// FOR TESTING.
    End If
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have created a module with this among others this function in it: <?php
I have dialog created like this $('#add_error').click(function(e) { $('<div>') .load('/someaction/format/html/') .dialog({ title: 'Some title',
I've got a javascript function I created. Somewhere in that function, this line is
I have a loop created with each, check this example: $('.foo').each(function(i){ //do stuff });
How would I create a nested list, I currently have this public function getNav($cat,$subcat){
I'm using the .remove() function from within jQuery to try and remove a form
I had this function that deleted historical data that was no longer needed from
Sometimes this function can be called too quickly and multiple elements are created but
I have this function: CREATE OR REPLACE FUNCTION CREATE_AIRSPACE_AVAILABILITY_RECORD (cur_user VARCHAR, start_time VARCHAR, start_date
I need to create a function that uses a loop. This function will open

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.