VB Coding-Database and SQL
VB Coding-Database and SQL
VB CODING
cboBox.Clear
'Clear the combobox in question, in case it isn't
sql = ""
'Clear SQL in case there is another var named SQL somewhere
'Setup SQL to select fields based on the values passed to the
function
sql = "SELECT " & IDField & ", " & descField & " FROM " & strTB
'Open the recordset with the data returned by the SQL statement
Set rs = db.OpenRecordset(sql, dbOpenForwardOnly)
With rs
Loop
.Close
1
End With '(rs)
Exit Sub
End If
End Sub
'------------------------------------------------------
'Author:Chris O'Leary
'Posted:5/26/98
'[email protected]
'
'Shows the text property of a listbox in the tooltip property,
'when the mouse hovers over the listbox for a second. Relies
'on the SendMessage API, declared in the API_Routines file.
'------------------------------------------------------
' show the tooltip or clear last one, make sure the index is
'greater than or equal to 0 and not greater than the
listcount
2
If (lIndex >= 0) And (lIndex <= .ListCount) Then
.ToolTipText=".List(lIndex)" 'Return the text=".list(lIndex)" Else
.ToolTipText 'Return nothing
End If
End If '(button=0)
End Function