Can anyone tell me whay this does not work, and how to make it work. I have SiteNumbers that are 5 digits long and those that are 7. So, those below 00090, I need to pull in those 5 digits. Numbers over 00090, I need to pull in 7 digits. Here's the code I tried, and it will not work. If I just use the 00090, it takes off the 0s, and leaves me with a < 90.
Thanks
Pat

If Mid$(Trim(cmbSite.Text), 6) < 90 Then
strOnlySiteNumber = Mid$(Trim(cmbSite.Text), 3)
Else
strOnlySiteNumber = Left$(Trim(cmbSite.Text), 7)
End If