|
Visual Basic (VB and VBA) |
|
Copyright 1999-2001 Christopher Greaves. All rights reserved. Home Page and email to [email protected] |
| If in doubt, record a macro and inspect the entrails! |
Please read the DISCLAIMER.
Here is an INDEX to all the procedures.
You will probably need one copy of my GLOBAL DECLARATIONS.
Public Function lngIndexToComboBox(cmb As ComboBox, strText As String, Optional boolCase As Boolean = False) As Long
' Procedure : lngIndexToComboBox
' Description: Return the comboIndex of a string in a combobox.
' Copyright: Chris Greaves Inc.
' Inputs: None
' Returns: LONG -1 if not found
' Assumes: Nothing
' Side Effects:
' Tested: By a call from the user.
'' Dim bool As Boolean
'' If IsMissing(boolCase) Then
'' bool = False
'' Else
'' If UCase(boolCase) = "Y" Then
'' bool = True
'' Else
'' bool = False
'' End If
'' End If
lngIndexToComboBox = -1 ' default result is failure
Dim lngI As Long ' loop counter
For lngI = 0 To cmb.ListCount - 1
If boolCase Then
If UCase(cmb.List(lngI)) = UCase(strText) Then
lngIndexToComboBox = lngI
Exit For
Else
End If
Else
If cmb.List(lngI) = strText Then
lngIndexToComboBox = lngI
Exit For
Else
End If
End If
Next lngI
End Function
| We all knew nothing when we started … |
|
Home Page and Contact Information Send email to [email protected]. This page was last updated Thursday, November 15, 2001 |