Selecting a value from an unbound combo box in Access 2000

ideefixe

Registered User.
Local time
Today, 21:53
Joined
May 30, 2006
Messages
28
Selecting a value from an unbound combo box in Access 2000

Hi,

I am attempting to default a combo box to a value I have passed in. I have already populated the combo box dynamically by setting the column numbers and widths and specifying the row source as Value List, supplying the row source string.

Since I am working with classes and collections, I wish to avoid data binding as I would prefer that the classes handle everything, which they can do.

Now my problem is that I cannot find how to select the correct value on the dropdown after populating it with all the values. When I try a line like:

cboAppType.Column(0) = lngValue (where lngvalue corresponds with a value in the list)

it returns the error "object required". It won't recognise the column at all, even though it sees and displays the rows and columns.

I am beginning to tear my hair out as I have been struggling against Access all the way to try and implement unbound combo boxes and listboxes and having overcome everything else, I'm stuck just here.

Any help very much appreciated - thank you
 
silly question but have you bound the column of the combo box?
bound column =?
 
Rob I apologise for getting back to this so late. Thanks for your help.

It wasn't a stupid question - I hadn't bound a column since I assumed that my combo box being unbound to any table meant that it was pointless to have one. I was wrong. I now have a hidden bound column in my combo boxes and that works for selecting.

However I must add that I have learned the hard way that Access VBA is highly unfriendly towards class-centred, middle-layered programming. Positively inimical, in fact. It is a pointless endeavour to design an unbound form in Access. In case any of you were planning on following my example :)
 

Users who are viewing this thread

Back
Top Bottom