Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ComboBox Error

Status
Not open for further replies.

RaffiqEddy

Programmer
Jan 7, 2002
51
MY
Hi!

Please help me, I want my combo box to return values...

so I did this...

Private Sub nComboBox1_Change()
Me.nTextBox1 = Me.nComboBox1.Columns(2)
Me.nTextBox2 = Me.nComboBox1.Columns(3)
End Sub

ComboBox Info
=============
ComboBox Name: nComboBox1
Column: got 3 columns

The Problem
===========
After I selected value from the combo box, but I got Error...

Quote:
The expression On Change you entered as the event property setting produced the following error: A problem occurred while MySystem was communication with OLE server or ActiveX Control

* The expression may not resut in the name of macro, the name a user-defined function, or [event Procedure]
* There may have been an error evaluating in the function, event or macro.
Unquote

What's wrong?

Thank you for kind help :-D
 
A couple of things to look at.

First, I think the error you're getting comes from the letter 's' at the end of the word 'Column'. Second, with combo boxes, the columns are counted starting with zero.

Change

Me.nComboBox1.Columns(2)
Me.nComboBox1.Columns(3)

To

Me.nComboBox1.Column(1)
Me.nComboBox1.Column(2)


HTH


John

Use what you have,
Learn what you can,
Create what you need.
 
Hi John!

let me try.....

Ops! Still not working, the same error appear

BTW, I have tried another solution, I've commented the code like this..

Private Sub nComboBox1_Change()
'Me.nTextBox1 = Me.nComboBox1.Column(1)
'Me.nTextBox2 = Me.nComboBox1.Column(2)
End Sub

You know what?

The same error appear again !!!

What wrong???
 
I'm not sure, but try next:
look at you're references. Maybe you've to make a reference between activeX and VBA.
Offtopic: I don't know what activeX error and combobox matching but.....
I hope this will help you a little further
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top