Hi,
When I load the form, I want to load all zipcode table into the cbx but I want to leave the zip code of the first client selected. And when I change client I want to change the cbx text value.
any idea?
thanks
Printable View
Hi,
When I load the form, I want to load all zipcode table into the cbx but I want to leave the zip code of the first client selected. And when I change client I want to change the cbx text value.
any idea?
thanks
you could use the sendessage api to find and select an item in the combo.
VB Code:
Option Explicit 'set style of combo to 2-dropdown list Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Integer, ByVal lParam As Any) As Long Private Const CB_FINDSTRING = &H14C Private Sub Form_Load() Combo1.Clear Combo1.AddItem "peet" Combo1.AddItem "muzzi" Combo1.AddItem "hack" Combo1.AddItem "beachbum" Combo1.AddItem "darre1" Combo1.AddItem "plenderj" Text1.Text = "muzzi" End Sub Private Sub Text1_Change() Combo1.ListIndex = SendMessage(Combo1.hwnd, CB_FINDSTRING, -1, ByVal CStr(Text1.Text)) End Sub
that what you are after ?
Thanks a lot peet!!!
your welcome pintojoa :)