combo box to look up records won't work

P

Patrick Goodyear

Hello,

I have a combo box on a form that I am trying to use to look up records
in a a table.

The combo box gets its value list from a field in the table that the
form is based on.

The combo box correctly shows the values. However, I cannot select a
value in the combo box. When I highlight the value I want, nothing happens.

The combo box is unbound, which I understand is okay.

Using the code builder with debugger, it seems like the combo box never
gets to it's After-Update event.

I have followed the method given in the Access help file, and two other
references for creating the combo box via the wizard with the same result.

I guess I have a form or combo box property set just wrong, but I can't
find which one, and I haven't found any reference to this problem, other
than the Access help file, which says I must have misspelled something
in the ControlSource property of the Combo box (but it's unbound!)

Any help is greatly appreciated.

Kind Regards,

Patrick
 
A

akphidelt

Typically this happens when you have the wrong column bound. I know from
experience that when you create a combobox through the wizard it typically
adds an unseen ID column as the bound column, although what you see is the
text that you want to see. If that's not the case, can you post your After
Update code?

Also if you are familiar with the VBE it is useful to use the Immediate
Window under view.

Then you can type out
?Forms!myform!mycontrol

And it will give you the actual value of that control that access reads. And
I'm sorry if you are beyond this point and im just preaching to the choir.
 
L

Lee Woodhouse

I've just had exactly the same problem. I think this may be the solution your
after.

The form containing your combo box is set to 'Read Only' when opened,
overiding the AllowEdits setting in the forms properties. It needs to be set
to either 'Add' or 'Edit' mode when opened.

I suspect your form is opened using a macro (as opposed to the vb
DoCmd.Openform script). You need to edit the OpenForm setttings of your macro
and change to 'Edit'.
 
L

Linq Adams via AccessMonster.com

when you create a combobox through the wizard it typically adds an unseen ID >column as the bound column,

Not true on a form. On a form the column the wizard binds is the first field
selected in the combobox wizard. I believe you're referring to the wizard to
create a lookup field in a table.

As Lee stated, the usual reason (barring corruption) that a selection cannot
be made from a combobox is that, for some reason, the form itself is non-
editable. There are a number of things that can cause this, including the
form being based on a non-editable query, the form being called in a read-
only mode, or the form's AllowEdits Property being set to No.
 

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

Top