Using text box enabled property on a continuous form

J

jtertin

I have a continuous form with a text box that I would like to enable/
disable based on a condition within each iteration of the continuous
form.

I have a combo box that has a hidden boolean column. I want the text
box to only be enabled if that column's value is -1 (True). I have
VBA logic to change the Enabled property based on this that works
fine, the only problem is that it changes ALL of the iterations of the
said text box throughout the entire continuous form. Is there any way
to localize this behavior only to the current iteration?

Thanks!
 
G

Guest

That's going to be hard. A continuous form actually has one text field which
is repeated. So if you set it to enabled you are actually telling the one
textbox to be disabled and vice versa. In runtime the form will never know
what the current record is because it's iterating through a collection. So as
far as Access is concerned the last record is the current and the one
textfield on the form is the current one.
 
J

jtertin

That was my impression of how they worked. I just didn't know if
there was a way around this to be able to call them out individually.
It would be nice to be able to refer to the iteration number of the
continuous form's "collection" (and it's members) so you could do
things like that.
 
J

jtertin

Interesting phenomenon when I use conditional formatting (thank you
for that suggestion by the way):

When I configure conditional formatting to change the textbox's
Enabled property, the form loads as it should (enabled/disabled as
appropriate). However, when I change a value in any of the referenced
objects (the value I am looking at to determine proper formatting),
ALL of the conditionally formatted controls update to reflect the
state after the edit.

For example: If I have a text box that is enabled/disabled based on
the state of a check box on a continuous form (checked=enabled), the
form will load properly initially, but if I check or uncheck any of
the check boxes, ALL of my text boxes will enable/disable based on the
state of the newly checked/unchecked box.

We're half way there! Any suggestions to get me over this hurdle?
 
G

Guest

It sounds like you are using datasheet view. Try switching to continuous view.
I did not test this, but I think I remember doing some testing with it a
year or so ago, but if I am misleading you, I apologize.
 

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