Update combo box in Macro Environment

Earl C Phillips

Volunteer Programmer
Local time
Today, 05:42
Joined
Jul 18, 2008
Messages
40
I copied Students application in Access 2007 and modified it to fit needs of a school for students with disabilities. I know absolutely nothing about macros, so where needed I substituted VBA. It is now a mix of macros and VBA. But now I cannot post values from a combo drop-down list on the second tab. I get a "boink" sound when I try to post the selection. I have adjusted the properties of each combo field to match where it was successful before and tried again. No results.

The fields are located on the second tab which lists contacts for the student. The proper values show up in the drop-down list. It is just that the value chosen will not populate the field.

I have used combo boxes extensively before, but never in a macro environment. I would like help so I can finish this pro-bono program.
 
As much as I hate Macros, I doubt that they are the culprit, here! The usual reason for Comboboxes going 'boink,' meaning that selections cannot be made from them, is that the Form it resides on cannot be edited, and the Access Gnomes, in their infinite wisdom, consider making a selection from a Combobox to be 'editing!'

Look at the Properties of the Form (Properties - Data) to see if the AllowEdits Property is set to 'No;' if it is, change it to 'Yes.'

If the Form is opened from another Form, look to see what parameters were used; they're not always clear as to what they allow. Both of these Commands

DoCmd.OpenForm "FormName", , , , acFormAdd

DoCmd.OpenForm "FormName", , , , acFormReadOnly


do not allow editing of the Form.

If the Form can also be used to enter data, check that this can actually be done, that it is not Read-Only, due to it being based on a multi-table Query that cannot be updated.

Linq ;0)>
 
The code generated from the macro is "DoCmd.OpenForm "Student Details", acNormal, "", "[ID]=" & Nz(ID, 0), , acDialog" which does not have any of the problems you mentioned. I looked for any and all properties parameters that could cause the problems and tested them one by one. Let me point out that this is on a subform within the tab for "contacts". Still does not work, yet subforms on other tabs work just fine. Baffleing.

Thanks anyway.
 
If this is on a Subform, have you checked the 'AllowEdits' Property for the Main Form? Changes made to a Subform are considered to be 'editing' of the Main Form, since that is where the Subform Control resides.

Is there other data on the Subform the Combobox is on, and if so, can you edit this data?

Linq ;0)>
 
AllowEdits is Yes on the main form and the subform. There are other subforms on other tabs that work as expected. The drop-down boxes on this tab populate correctly. Highlighting within the drop-down occurs. It just does not extract an entry from the drop-down box and populate the combo box text field.

There are four combo boxes on the sub-form and none of them work. The other data on that subform is a text box containing the key to the main record, with the key being changable, and a field defined with "=IIf(IsNull([GuardianID]),"(New)","Open")" allowing click on "Open" to open a guardian form. I will change the key text box to prevent alteration.

Thanks for the tips. It gives me information for the future, but does not explain my current dilema. I am an ex-mainframer stuck in a PC world.
 

Users who are viewing this thread

Back
Top Bottom