By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
462,077 Members | 780 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 462,077 IT Pros & Developers. It's quick & easy.

Assign string into an Object

P: 158
Hi expert,

Need some advise on assigning string into an object.

Expand|Select|Wrap|Line Numbers
  1. slot = lvwLotsToSkip.ListItems.Item(i).text
  3. Dim olot As Object
  4. olot = slot
  5. rc.Init olot, Nothing, Nothing, "SkipMultipleLot"
Above is my code and its not allowed me to assign object into string.Kindly advice.
Feb 17 '12 #1
Share this Question
Share on Google+
3 Replies

Guido Geurs
Expert 100+
P: 767
"... As Object " is not an object but:
(see VB Help)

Object variables are stored as 32-bit (4-byte) addresses that refer to objects. Using the Set statement, a variable declared as an Object can have any object reference assigned to it.

Use the "Set" to make an objext like Textbox and then you can put text in it.
Feb 18 '12 #2

P: 158
I have change the code.but still having the same error.object required.Kindly help

Expand|Select|Wrap|Line Numbers
  1.     Set oLot = sLot
  2.  rc.Init oLot, Nothing, Nothing, "SkipMultipleLot"
Feb 21 '12 #3

Guido Geurs
Expert 100+
P: 767
Set is not to assign a value to an object!
Set assigns an object reference to a variable or property.

Expand|Select|Wrap|Line Numbers
  1. Dim myChildForms(1 to 4) As Form1
  2. Set myChildForms(1) = New Form1
Feb 22 '12 #4

Post your reply

Sign in to post your reply or Sign up for a free account.