unbound controls

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

so i have a problem with the way that 'allow edits' works for a form.

I am using Access Data Projects; and I am not sure how well this relates to
MDB-- I haven't had to use a MDB for almost 5 years now

1) when a form is in 'allowedits = false' why is it that i can't change an
unbound control? it is an unbound control; it just seems like there should
be an easy way to specify that certain controls can be editied-- and others
not editied

I guess I'm looking for an alternative

Perhaps I shoudl go thru and enable and disable certain controls
programmatically

i basically have a control at the top of each form that allows people to
select what 'mode' they are in:

Add/Edit/View

and I can't use the 'AllowEdits' to do anything since then i can't let
people change the mode back to edit/Add; etc

it's just annoying.

i should be able to change an unbound control when 'allowEdits = false'
because it isn't really changing the Data-- it is just changing the control.
If it is an unbound control; it should let me change it if and when i want--
again since it isn't changing the data.

hope someone has an easier solution
 
Yes, you must go through and enable/disable each controls separately. The
easiest way might be to use the Tag property to know which control must
enabled/disabled.

For Add/Edit/View problem, you can set on click event on them and modify the
displayed value/format programmatically.

S. L.
 
You can use a tab control as a container. Set the Style property of the tab
control to None to hide it, and toggle the Enabled property of the tab
control to enable/disable all the contained controls.

I don't think I've ever actually used this in a production app. I use the
Tag property as Sylvain suggests, and that works well enough for me. But I
have tested the method using the tab control, and it appears to work well
enough too as far as I can see.
 
I use the On Got Focus & On Lost Focus for the few unbound controls that I
want to be able to edit while the form edit is disallowed. I actually set
AllowEdits = True On Got Focus and vice versa. The trick is to know the
prior state before changing it because if you were in edit mode and On Lost
Focus it took you out that would be bad.

HTH,
Jim
 
Back
Top