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

If Len Function Create hyperlink

Status
Not open for further replies.

robbie59

Technical User
May 9, 2001
36
US
I have a field that may return a number such as 589 or 1287 I need to turn these numbers into hyperlinks to an actual file based on the number of charaters such as if 589 is returned i need to make it into a hyperlink to or if a four digit number such as 1287 is returned i need to display a link such as 00001287.cmp basiclly I get a filename returned without the leading zeros I just need to add the leading zeros to the filename to = 8 total numbers and return it as a hyperlink to the file. I would be grateful for any help with this.

Rob

If knowledge were power I would be a AAA battery!
 
someNum = 589
someNumStr = someNum + ""
do while len(someNumStr) < 8
someNumStr = &quot;0&quot; & someNumStr
loop

myLink = &quot; & someNumStr & &quot;.cmp&quot;

Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook (No, I'm not Rick)

fart.gif
 
Sorry I am just a beginner I am not quite sure how too use your code inside a table cell here is the actual data source.
<%=(Recordset1.Fields.Item(&quot;JobNumber&quot;).Value)%>

If knowledge were power I would be a AAA battery!
 
If you could post the relevant code, I could show you where to put this...

Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook (No, I'm not Rick)

fart.gif
 
here is my table code with the record being jobnumber recordset being what I need converted to a hyperlink, I think this is what you need

<td width=&quot;10%&quot; bgcolor=&quot;#CCCCCC&quot;> <div align=&quot;center&quot;><%=(Recordset1.Fields.Item(&quot;JobNumber&quot;).Value)%></div></td>

If knowledge were power I would be a AAA battery!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top