Thanks so much for you help!!
From: RaviKumar Gurrapu [mailto:mail2grk@y...]
Sent: Tuesday, May 01, 2001 02:46 AM
Subject: [vb_howto] Re: Combobox listing
The following solution will not work in all cases. I am giving temporary
solution. Try to implement as per ur requirement.
Change validate event as follows.
Private Sub Combo1_Validate(Cancel As Boolean)
'COMBO_TEXT = Trim(Left(Combo1.Text, 10))
'Combo1.Text = COMBO_TEXT
Combo1.Text = Trim(Left(Combo1, InStr(Combo1.Text, "|") - 1))
Combo1.Width = 1500
> Dear all,
> I am using the combobox to show a listing consisting of 3 columns. I
> the combobox size to be the size of the first column since I have
> combobox right next to the first one, but have the user able to view all
> columns for selection and when the user makes a selection only the item
> the first item to show in the combobox.
> I have tried using a few ways to do this but cannot achieve what I want
> do. If anyone can help me I really really appreciate it. I don't know
> what else I can try.
> Below is the code for what I have tried. This will overlap the combobox
> next to the first one and doesn't work.
> You help will help me!!
> Thank you in advance.
> Private Sub Combo1_GotFocus()
> Combo1.Width = 8000
> End Sub
> Private Sub Combo1_Validate(Cancel As Boolean)
> COMBO_TEXT = Trim(Left(Combo1.Text, 10))
> Combo1.Text = COMBO_TEXT
> Combo1.Width = 1500
> End Sub
> Private Sub Form_Load()
> Set rs2 = CreateObject("ADODB.Recordset")
> rs2.Open "select * from shiplist", con, rdOpenForwardOnly, ,
> Do Until rs2.EOF
> Combo1.AddItem (Left(rs2("hull type") & Space(10), 10) & " | " &
> Left(rs2("ship name") & Space(20), 20))