Disable Controls + subform on a Form but keep one field enabled

B

Billp

Hi,

Is it possible to disable controls on a form, on current, but allow one
combobox to remain active?
When veiwing customer records it is necessary to have the controls/fields
disabled so that they cannot be changed but have one control, the combo box,
(cboCustomerID) enabled to allow navigation directly to a customer.
The navigation buttons allow choice of a new record so that data can be added.
Can a subform be also disabled along with the main form?
The subform is a continuous form.
 
B

Billp

Thanks Jeannette



Jeanette Cunningham said:
Hi Billp,
You can set allow edits to No for the form.
On the enter event for the cboCustomerID, put code to set allow edits to
yes, so user can choose a customer.
On the exit event for the combo, set allow edits back to no.


Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
 
D

Dale_Fye via AccessMonster.com

Jeanette,

Doesn't setting Allow Edits to form also prevent the user from making changes
to the unbound control cboCustomerID?

Dale

Jeanette said:
Hi Billp,
You can set allow edits to No for the form.
On the enter event for the cboCustomerID, put code to set allow edits to
yes, so user can choose a customer.
On the exit event for the combo, set allow edits back to no.

Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
[quoted text clipped - 8 lines]
Can a subform be also disabled along with the main form?
The subform is a continuous form.
 
D

Dale_Fye via AccessMonster.com

Personally, I prefer to lock the controls. Found some code on Allen Browne's
site

http://www.allenbrowne.com/ser-56.html

That allows you to lock and unlock controls. I've modified it a bit for my
purposes over the years, but this works really well. And because your
cboCustomerID field is not bound (or shouldn't be bound), then it does not
get locked.

HTH
Dale
 
D

Dale_Fye via AccessMonster.com

Oops!

That should read:

Doesn't setting AllowEdits to No also prevent the user from making changes to
unbound controls?

Dale
 
J

Jeanette Cunningham

Dale,
I have always used toggling the allow edits setting for an unbound combo
used for searching when the form has allow edits set to no.


Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
 
D

Dale_Fye via AccessMonster.com

Jeanette,

I've been using Access for a long time, but am not familiar with that
technique or property. Can you elaborate?

Dale

Jeanette said:
Dale,
I have always used toggling the allow edits setting for an unbound combo
used for searching when the form has allow edits set to no.

Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
Personally, I prefer to lock the controls. Found some code on Allen
Browne's
[quoted text clipped - 22 lines]
 
J

Jeanette Cunningham

Dale, you can find examples if you search the discussion groups.
Start with the form has allow edits set to No.
The combo won't work with allow edits set to no.
On the enter event of the combo, put code to set allow edits to yes.
After user makes their choice and the after update event for the combo fires
and user exits the combo, put code to set allow edits to no on the exit
event of the combo.
Now the user has been able to choose from the combo, and when they get to
the rest of the form, they can't edit the data because allow edits is set to
no.


Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia



Dale_Fye via AccessMonster.com said:
Jeanette,

I've been using Access for a long time, but am not familiar with that
technique or property. Can you elaborate?

Dale

Jeanette said:
Dale,
I have always used toggling the allow edits setting for an unbound combo
used for searching when the form has allow edits set to no.

Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
Personally, I prefer to lock the controls. Found some code on Allen
Browne's
[quoted text clipped - 22 lines]
Can a subform be also disabled along with the main form?
The subform is a continuous form.
 
D

Dale_Fye via AccessMonster.com

Thanks, Jeanette.


Jeanette said:
Dale, you can find examples if you search the discussion groups.
Start with the form has allow edits set to No.
The combo won't work with allow edits set to no.
On the enter event of the combo, put code to set allow edits to yes.
After user makes their choice and the after update event for the combo fires
and user exits the combo, put code to set allow edits to no on the exit
event of the combo.
Now the user has been able to choose from the combo, and when they get to
the rest of the form, they can't edit the data because allow edits is set to
no.

Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
Jeanette,
[quoted text clipped - 14 lines]
 

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