PC Review


Reply
Thread Tools Rate Thread

Accessing a control for a specific record using VBA

 
 
=?Utf-8?B?R2FldGFu?=
Guest
Posts: n/a
 
      1st Nov 2007
I have a continuous form in which I need to set the enabled property of a
specific control depending on the value of another control in the same record.

The problem is when I set the enabled property for the control, this control
is affected for all records on the continuous form. That means that if I have
15 records on the form, this specific control becomes disabled for all 15
records on the form, where I would want only the current record's control to
be disabled.

Anyone can help me with this problem?

Thanks in advance!
 
Reply With Quote
 
 
 
 
Douglas J. Steele
Guest
Posts: n/a
 
      1st Nov 2007
Sorry, but that's the way Access continuous forms are: while it may look as
though you've got 15 separate text boxes, in actual fact, you've got one
text box, repeated 15 times.

However, since you can't do anything with the text box unless it's the
current row, you could always put your code that disables the box in the
form's Current event, and it would only be effective when appropriate for
the current row.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"Gaetan" <(E-Mail Removed)> wrote in message
news:3194BE63-BF85-421E-BDED-(E-Mail Removed)...
>I have a continuous form in which I need to set the enabled property of a
> specific control depending on the value of another control in the same
> record.
>
> The problem is when I set the enabled property for the control, this
> control
> is affected for all records on the continuous form. That means that if I
> have
> 15 records on the form, this specific control becomes disabled for all 15
> records on the form, where I would want only the current record's control
> to
> be disabled.
>
> Anyone can help me with this problem?
>
> Thanks in advance!



 
Reply With Quote
 
Jeff Boyce
Guest
Posts: n/a
 
      1st Nov 2007
You can consider this a ... "feature" ... of the continuous form.

Instead, change your form to a "single form", but make it look like a row of
data. Then make your overall form tall enough to display several "rows" of
data (i.e., several single forms). Now when you modify a property of a
control, it should only happen on THAT (single) form.

Regards

Jeff Boyce
Microsoft Office/Access MVP

"Gaetan" <(E-Mail Removed)> wrote in message
news:3194BE63-BF85-421E-BDED-(E-Mail Removed)...
>I have a continuous form in which I need to set the enabled property of a
> specific control depending on the value of another control in the same
> record.
>
> The problem is when I set the enabled property for the control, this
> control
> is affected for all records on the continuous form. That means that if I
> have
> 15 records on the form, this specific control becomes disabled for all 15
> records on the form, where I would want only the current record's control
> to
> be disabled.
>
> Anyone can help me with this problem?
>
> Thanks in advance!



 
Reply With Quote
 
Albert D. Kallal
Guest
Posts: n/a
 
      2nd Nov 2007
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. I mean, when you move
to the next row, those columns that you enable, or disable can then
be set. So, you could set the controls visible property as you move
the cursor up/down through the

In fact, I actually PREFER the above behavior, as then during
data entry it is VERY easy to see that the column in question
is enabled.

In place of a VERY HARD TO READ checkerboard pattern of enabled, and
disabled boxes,
, you get a very nice enable/display view as I move the cursor up /down.

I have uploaded a gif animation of me navigating in a form, both of the two
screen shots will give you an idea of how this looks.

http://www.members.shaw.ca/AlbertKal...lumn/index.htm



--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
(E-Mail Removed)


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
opening to a specific record from a listbox control Pwyd Microsoft Access Macros 3 21st May 2008 08:18 PM
bringing up a specific record in FormView control davidgreen24@gmail.com Microsoft ASP .NET 0 5th Dec 2006 10:48 PM
accessing specific record ifoundgoldbug@gmail.com Microsoft Access Form Coding 1 14th Jul 2006 08:11 PM
Control button looses link to specific record in underlying form =?Utf-8?B?TXMuIE1heWhldw==?= Microsoft Access Forms 3 10th Jul 2006 08:24 PM
[VB2005EE] accessing control-specific functions via form's ActiveControl Aphazel Microsoft VB .NET 4 11th May 2006 10:42 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:16 PM.