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

Search File List Box

Status
Not open for further replies.

dvannoy

MIS
May 4, 2001
2,765
US
I created a jpg viewer to view scanned documents. I want to put code behind a button that when the user clicks it, it will pop up a inputbox and ask for doc#...once they enter the number it will then highlight the number in the file list box...

can anyone help?

thanks dvannoy@onyxes.com
 
Private Sub Command1_Click()
Dim vRetVal As Variant

vRetVal = InputBox("Enter the Image List Number." & vbCrLf & "Between 1 and " & File1.ListCount & ".", "Image Number...?", "1")
If IsNumeric(vRetVal) Then

If vRetVal > File1.ListCount Then
MsgBox "A number Between 1 and " & File1.ListCount & " I said ya DOPE!.", vbOKOnly + vbExclamation, "Yer an idiot"
Exit Sub
End If

vRetVal = IIf(Int(vRetVal) - 1 < 0, 0, Int(vRetVal) - 1)
File1.ListIndex = CLng(vRetVal)

Else
MsgBox &quot;Enter a numnber, DUMMY!&quot;, vbOKOnly + vbExclamation, &quot;Yer an idiot&quot;

End If

End Sub

Bit of validation there for you too. :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top