Strange Problem with Bound Combo Box Control when it is Deleted from the Form

  • Thread starter dalecorey1 via AccessMonster.com
  • Start date
D

dalecorey1 via AccessMonster.com

Hi folks,

I'm hoping you can help. I have a combo box on my form bound to a field
called NON_LABOR_DEPT_CODE. When I delete this combo box on my form and try
to load the form again, the check box (Yes/No) controls that are bound to the
same table of this field become grey as if it can't bind to those fields.
However, if I add the control back for the combo box and reload the form, the
check box (Yes/No) controls load normal and appear to be bound probably. The
NON_LABOR_DEPT_CODE is not part of the primary key.

Any ideas what the heck is going on?

TIA,

Dale

--
Sincerely,

Dale Corey

Message posted via AccessMonster.com
 
M

Marshall Barton

dalecorey1 said:
I'm hoping you can help. I have a combo box on my form bound to a field
called NON_LABOR_DEPT_CODE. When I delete this combo box on my form and try
to load the form again, the check box (Yes/No) controls that are bound to the
same table of this field become grey as if it can't bind to those fields.
However, if I add the control back for the combo box and reload the form, the
check box (Yes/No) controls load normal and appear to be bound probably. The
NON_LABOR_DEPT_CODE is not part of the primary key.


"going gray" means that the control is disabled. If the
control's bound field were no in the form's record source,
it would display #Name.

Check the code behind the form to see if if you are setting
the control's Enabled property to False. Another
possibility is that the control's Conditional Formatting has
the Enabled property off when the combo box meets a
condition.
 
D

dalecorey1 via AccessMonster.com

Wow! You are a genious! I had forgotten I had put this code in the "Add
Record" subroutine:

For Each ctl In Me.Controls
ctl.Locked = False
Next

Basically, I use this code for restricting data entry when "Looking up"
records versus unlocking all the controls when "Adding records".

Thanks for the heads up!

Dale

Marshall said:
I'm hoping you can help. I have a combo box on my form bound to a field
called NON_LABOR_DEPT_CODE. When I delete this combo box on my form and try
[quoted text clipped - 3 lines]
check box (Yes/No) controls load normal and appear to be bound probably. The
NON_LABOR_DEPT_CODE is not part of the primary key.

"going gray" means that the control is disabled. If the
control's bound field were no in the form's record source,
it would display #Name.

Check the code behind the form to see if if you are setting
the control's Enabled property to False. Another
possibility is that the control's Conditional Formatting has
the Enabled property off when the combo box meets a
condition.

--
Sincerely,

Dale Corey

Message posted via AccessMonster.com
 
M

Marshall Barton

Careful there Dale, there must be more to it than that. The
Locked property is different from the Enabled property.
Setting Locked to True or False does not affect a control's
appearance unless the control's Enabled property is set to
False. I.e A disabled and unlocked control will appear gray
while a disabled and locked control will appear normal.
--
Marsh
MVP [MS Access]

Wow! You are a genious! I had forgotten I had put this code in the "Add
Record" subroutine:

For Each ctl In Me.Controls
ctl.Locked = False
Next

Basically, I use this code for restricting data entry when "Looking up"
records versus unlocking all the controls when "Adding records".

Thanks for the heads up!

Dale

Marshall said:
I'm hoping you can help. I have a combo box on my form bound to a field
called NON_LABOR_DEPT_CODE. When I delete this combo box on my form and try
[quoted text clipped - 3 lines]
check box (Yes/No) controls load normal and appear to be bound probably. The
NON_LABOR_DEPT_CODE is not part of the primary key.

"going gray" means that the control is disabled. If the
control's bound field were no in the form's record source,
it would display #Name.

Check the code behind the form to see if if you are setting
the control's Enabled property to False. Another
possibility is that the control's Conditional Formatting has
the Enabled property off when the combo box meets a
condition.
 

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