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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Quotation Marks in Strings 1

Status
Not open for further replies.

fogal

Technical User
Aug 20, 2001
87
US
Please help with the line below !

Me!NETID1 = ctl.ItemData(varItm)

I am trying to split NETID1 into

NETID and 1

i.e me!netid & 1 etc....

But this does not work ?
 
Hi!

If I follow your question correctly, you will need to do it this way:

Dim strControlName As String

strControlName = "NETID" & "1"
Me.Controls(strControlName) = cntl.ItemData(varItem)

It looks like you are using this in a For Each loop so you may be looking for a way to increment the number:

Dim strControlName As String
Dim intControlNumber As Integer

intControlNumber = 1

strControlName = "NETID" & Format(intControlNumber)
Me.Controls(strControlName) = cntl.ItemData(varItem)
intControlNumber = intControlNumber + 1

hth
Jeff Bridgham
bridgham@purdue.edu
 
FYI Only...
Also be warned about single quote marks in strings. I recently encountered that one. For example... "file's name is x". The solution was to use a double quote. "file''s name is x". Steve Medvid
"IT Consultant & Web Master"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top