Property or method not supported.

mafhobb

Registered User.
Local time
Today, 17:16
Joined
Feb 28, 2006
Messages
1,249
Anyone knows why I am getting a Runtime error 438 "Object does not support this property or method" in this line of code?

Code:
txtbody = " Dear " & lblCustName.Caption & ", we have accepted the return of your item. The transaction number is " & lblTrans.Caption & " and RMA number is " & lblRMA & ". Our address is (Revell Address here). We will let you know when we receive it." & vbnewline & "Thank you."

txtbody is a string.

Thanks

mafhobb
 
What are lblCustName, lblTrans, lblRMA are they all labels?? Are these information from a Form?
 
Yes. Is this the problem?
 
Figured it out. Can't use labels that way. I replaced them with textboxes and then created variables to get the values.

The code is working now except that vbnewline does not move the text following it to a new line:

.txtBod = " Dear " & CustName & ", we have accepted the return of your item. The transaction number is " & Trans & " and RMA number is " & RMA & ". We will let you know when we receive it." & vbNewLine & "Thank you." & vbNewLine & "Your Team."

Why?

mafhobb
 
Last edited:
That worked. Though I do not understand what is the difference between the two. I'll do some research.

Thanks PR2

mafhobb
 
I am not entirely sure.. vbNewLine should get it to a new line.. but sometime it does not give the required result.. In theory, Carriage return moves the cursor back to the beginning of the line and Linefeed moves the cursor position down one line without moving the cursor back to the far left.. vbCrLf is the combination of the both.. so it work without fail for some reason.. :) Glad to be of assistance..
 
vbNewLine might be something you use for C (language) compatibility. C "ASCII stream" files end either on Carriage Return OR Line Feed (and don't need both), depending on your implementation. Visual C++ does this sometimes. C++ in other O/S will also do this.
 

Users who are viewing this thread

Back
Top Bottom