Combo Box - set text problem

  • Thread starter Thread starter Agnes
  • Start date Start date
A

Agnes

My combo Box 's datasource is the table without databinding.
Now , i need to set some value , I try Me.cboUnit.Text =
drInvoice.item("unit") , HOWEVER, it didn't work . I can't assign to that
combo box. e,g drInvoice.item("unit") should be 'ABC'
(the user can select ABC from the combox BUT I cannot assign it , why ?)
i try to print messagebox.show(Me.cboUnit.Text & " " &
drInvoice.item("unit") )
drInvoice.item("unit") really store "ABC", but Me.cboUnit.Text got blank,
Please help !!
 
Agnes,

Did you set the displaymember to the column of the datatable that has to be
showed.

\\\
mycombobox.displaymember = "mycolumn"
////
I hope this helps?

Cor
 
Dear Cor,
Me.cboUnit.text = drInvoice.item("unit") is work and I know what's wrong
with my data.
Basically, I import my vfp database into SQL sever, the field'unit' is
char(10) in VFP, but I changed it into nvarchar(10) into SQL Server, the
dtInvoice's data are imported from VFP.
My solution is " update invoice set unit = trim(unit)" then I can fill the
combo box now.
I spend over 10 hours about it ~~~~ Anyway . Thank for your reply

from agnes
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top