Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

dynamic object name

Status
Not open for further replies.

perlnewb00

Programmer
Joined
Nov 13, 2006
Messages
3
Location
US
I am pretty new to VBscript. I have a function that creates a new ojbect record but I would like record type to be changed based on the string I pass to the function. Is that possible?

Here is what I currently have:
Function AddObject(recordtype)
....
....
obj.Contact.NewRecord 'Creates a new Contact Record
....
....
End Function

I would like to be able to change the new record type based on the 'recordtype' string I pass in. So it would look something like obj.recordtype.NewRecord instead of hardcoding the record type everytime.
 
Something like this ?
Execute "obj." & recordtype & ".NewRecord"

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top