Ver Mensaje Individual
  #2 (permalink)  
Antiguo 01/05/2006, 20:42
Avatar de Frehley
Frehley
 
Fecha de Ingreso: junio-2005
Ubicación: Somewhere between Heaven and Hell
Mensajes: 415
Antigüedad: 18 años, 11 meses
Puntos: 0
Luego de que la conección por ADO está creada y funcionando y tengas el recordset declarado utilizá este codigo. Es una rutina para que agregue a un combo1 los nombres sin repetirlos. Espero sea lo que querias.

Option Explicit
Private Declare Function SendMessageString Lib "user32" Alias "SendMessageA" _
(ByVal hwnd As Long, _
ByVal wMsg As Long, _
ByVal wParam As Long, _
ByVal lParam As String) As Long
Private Const CB_FINDSTRINGEXACT = &H158
Private Const LB_FINDSTRINGEXACT = &H1A2
Public newitem As String


Sub searchcombo()
newitem = NombreRecordSet!NombreCampo
Dim lngRetVal As Long
lngRetVal = SendMessageString(Combo1.hwnd, _
CB_FINDSTRINGEXACT, -1&, _
newitem)
If lngRetVal = -1& Then
Combo1.AddItem newitem
Else
Beep

End If
End Sub


Private Sub Form_Load()
call searchcombo()
End Sub
__________________
diegoz.com.ar