10

This should be a quick one for you access vets, but from trying different properties and googling about, I can't fix it:

A combobox on my form won't allow me to select an item/value. I click on it, it's correctly populated, but I cannot select any of the items. The control source of this comboBox is set to a field in a table from a query(on which the form is based). The row source for this comboBox is set to a table which defines the allowed selections(say '1','2','3','4',or '5'). So, I want to constrain the data to only those items specified in the row source for the combobox - that was my solution.

The form is set to allow edits, additions, etc. The combobox control is not set to 'locked.'

Do any explanations / solutions come to mind?

EDIT: This also applies if the control is a text box - it must be something wrong with the control source?

Jota
  • 17,281
  • 7
  • 63
  • 93
Scotch
  • 3,186
  • 11
  • 35
  • 50
  • Yup, the record source is editable. All of the other controls on the form work, barring the comboboxes for the 3 additional fields I just added to the table and query for the form. – Scotch Jul 12 '12 at 17:06
  • 1
    Have you decompiled? Compacted & repaired? Checked your bound column? Ensured that the row source runs properly when pasted into the query design window? – Fionnuala Jul 12 '12 at 17:12
  • Yup, compacted and repaired, Tried both 1 and 0 for bound columns, Row source works on the control and query design -- I just can't select anything. I click on the values and nothing happens. The control source is spelled correctly. Only thing is, usually when I add a control on a form, I choose 'Add Existing Fields" and select the correct control source. In this case, that would give me a text box when I needed a combo. So I made a combobox control both with the wizard and without it and just typed the control source in. – Scotch Jul 12 '12 at 17:19
  • Update - It is not a problem with the combobox control - it must be related to the record/control source. I added a textbox for the same control source and I can't type anything in it. – Scotch Jul 12 '12 at 17:29
  • But have you decompiled? It's not the same thing as Compact & Repair. http://stackoverflow.com/questions/3266542/ms-access-how-to-decompile-and-recompile – HansUp Jul 12 '12 at 17:39
  • I will follow those instructions and try decompiling. So, to give further information, if I add ANY control, bound or unbound to a control source, it doesn't allow me to edit it at all(whether its changing selectings in combobox or typing into a text box) – Scotch Jul 12 '12 at 18:03
  • 1
    If you can't even edit an unbound text box with the form set to allow edits, I can't think of any explanation other than the form is corrupt. It happens occasionally. And decompile could fix you up. Decompiling on a regular basis during development is often recommended to ward off corruption ... sort of a prophylactic measure. – HansUp Jul 12 '12 at 18:11
  • 3
    I figured it out -_-. There was a method called in the open event that iterates through the forms controls and locks them based on certain things. The joys of inheriting a database with minimal comments and no contact with the previous dev... This question is prety much irrelevent to anything I mentioned now. Thanks for the input though - I will probably decompile it before I deploy it. – Scotch Jul 12 '12 at 18:13

1 Answers1

7

There was a method called in the Form_Load() event that iterated through the control's forms and locked them by default unless a particular criteria was met. This can be a lesson to those developing databases that will be inherited in the future to comment your code to save the new guys a lot of headache!

Scotch
  • 3,186
  • 11
  • 35
  • 50