Instances Of A Control On A Continuous Form

  • Thread starter Thread starter Mark
  • Start date Start date
M

Mark

How can the instances of a textbox control on an continuous form be
addressd? Can a specific instance be addressed? For example, a continuous
form has ten records. How can the textbox for the eighth record be
addressed?

Thanks,

Mark
 
Rick,

Thank you for the quick response!

I'm looking for a way to make the eighth instance of the textbox in record
#8 not visible. Something like CtlInstance(8).Visible = False. This will
then leave the textbox for the other records visible. I want to do something
like conditional formating does.

Thanks,

Mark
 
Mark said:
How can the instances of a textbox control on an continuous form be
addressd? Can a specific instance be addressed? For example, a continuous
form has ten records. How can the textbox for the eighth record be
addressed?


The only active instance of a control in the detail section
of a continuous form is the one in the current record.

Using unbound controls in the detail section is rarely a
useful exercise. OTOH, if you want to apply a different
format to a control in some rows, then try using Conditional
Formatting (Format menu).
 
What makes record #8 unique? Not sure how you could do this in a continuous
form. Conditional formatting might work, but you would need to figure out
what expression to use that would return the appropriate record.
 
Marsh,

Thanks for responding!

I want to make the control in some rows not visible depending on the value
in another field. Conditional Formatting does not have an option to set the
visible property. Do you know any way to do this?

Thanks,

Mark
 
Conditional Formatting does not have an option to set the visible property.
Do you have any ideas of how to make record #8 not visible depending on the
value in another field?

Mark
 
Mark said:
Conditional Formatting does not have an option to set the visible property.
Do you have any ideas of how to make record #8 not visible depending on the
value in another field?

Mark

If you set the back style and the border style to transparent, and all
the colors, with the exception of the forecolor, associated with the
text box to be the same as the section color beneath, and conditional
formatting to set that forecolor to the color of the section beneath
when a condition is met, then it !!!should!!! disappear when the
conditional formatting condition is met.
I m not sure if the transparency thingmes are required.

--
--
Lyle

To subject an enemy belligerent to an unfair trial, to charge him with
an unrecognized crime, or to vent on him our retributive emotions only
antagonizes the enemy nation and hinders the reconciliation necessary to
a peaceful world.

Justice Frank Murphy
Yamashita v. Styer, 327 U.S. 1 (1946)
 
If you set the back style and the border style to transparent, and all
the colors, with the exception of the forecolor, associated with the
text box to be the same as the section color beneath, and conditional
formatting to set that forecolor to the color of the section beneath
when a condition is met, then it !!!should!!! disappear when the
conditional formatting condition is met.
I m not sure if the transparency thingmes are required.

BTW I know this solution sounds hokey but I believe it is the way Access
"hides" the database window, or, at least, used to hide the database
window, and a good thing, for that is where it "finds" or "found" objects
like tables and queries.
 
You can certainly move the record pointer, and grab data.

however, there is only ONE instance of each control...so, no, you can't
address a individual control. And, you can't switch "one" of them on/off
since there is only ONE of them!!!

The only work around is to use condition formatting as others have
suggested.

I certainly have a lot of continues forms where I set the controls 'enabled'
property on/off. While this actually makes all instances of the control go
disabled, I actually find this works quite well. So, you could set the
controls visible property as you move the cursor up/down through the
continues form. The fact that 'all' of them disabled when you are on a
record that should not allow data entry for that record actually works quite
well...
 
Albert,

Thank you for responding!

If there is only one instance of each control, how is conditional formatting
able to change fonts, colors and enable/disable the one instance?

I want to overlay a textbox over a combobox and depending on the value of
another field, expose either the textbox or combobox in each record. To do
this, I am thinking I need to make one visible and the other not visible.

Mark
 
Lyle,

Thanks for responding!

Yes, that will definitely give the visible/not visible effect. However ----

I want to overlay a textbox over a combobox and depending on the value of
another field, expose either the textbox or combobox in each record. To do
this, I am thinking I need to make one visible and the other not visible.

Mark

To do this, I am thinking I need to make one visible and the other not
visible.
 
Mark said:
I want to make the control in some rows not visible depending on the value
in another field. Conditional Formatting does not have an option to set the
visible property. Do you know any way to do this?


CF can not be used with the Visible property, but it can be
used to disable a control.

I think you're stuck with that or using Lyle's workaround.
 
If there is only one instance of each control, how is conditional formatting
able to change fonts, colors and enable/disable the one instance?

The non-current controls are just drawn, they are not windows. But as
each one is drawn using the same rules conditional formating can work.
I want to overlay a textbox over a combobox and depending on the value of
another field, expose either the textbox or combobox in each record. To do
this, I am thinking I need to make one visible and the other not visible.

Put the text box and the combo box in the same place, and in the
oncurrent event of the form make one of them visible and the other
invisible.
Both must be bound to the same table field for this to look right, if
necessary create an extra field in the table and sort out other fields
in the apfterupdate events.
The only downside of this is that when in combo-box mode, all the
other records will have a drop arrow showing too. But when you select
another record this will disappear.
HTH

David
 
Mark said:
Albert,

Thank you for responding!

If there is only one instance of each control, how is conditional
formatting
able to change fonts, colors and enable/disable the one instance?

Conditional formatting is a afterthought that was added to ms-access to
"solve" many problems as result of a design that has only ONE copy of the
text box. This feature was not available until later versions of ms-access
(the last 3 versions)..
I want to overlay a textbox over a combobox and depending on the value of
another field, expose either the textbox or combobox in each record. To do
this, I am thinking I need to make one visible and the other not visible.

As I mentioned, you can consider enabling/setting the control box, and as
the user moves up/down, then they will see the changes..but it applies to
all text boxes. So, for enabling/disable, I think this is very workable..but
for changing form combo to non combo..I don't think so.

Perhaps you can come up with a side by side design? here is a few screen
shots:

http://www.members.shaw.ca/AlbertKallal/Articles/Grid.htm

So, it would be the fields/controls on the "right" side of the form that you
set. This right side of the form would only show one record from the "many"
side.
 
Back
Top