[AccessD] Disabling an Option Group

Stuart McLachlan stuart at lexacorp.com.pg
Sun Jan 14 15:30:56 CST 2024


> So, if OnPaint follows the conditional formatting behavior, 

It doesn't. That's not how  painting works. It's much lower level.


Try this:
Private x As Long

Private Sub Detail_Paint()
    If Num1 = 6 Then
        Text3.BackColor = &H666666
    Else
        Text3.BackColor = &HFFFFFF
    End If
    x = x + 1
    Debug.Print x
End Sub

And see how many paint events happen when you move between records and even when 
you move between controls on a record.


On 14 Jan 2024 at 13:11, Rocky Smolin wrote:

> The field is not true for every record.  The option frame starts
> Enabled=True as default.  So, if OnPaint follows the conditional
> formatting behavior, it should disable the option frame only
> Me.fldTenantLeaseStepHeading = True.
> 
> I did watch the vid starting at :47. Since I don't do classes, it was
> a bit obscure.  But what I did see when he demod the results is that
> the formatting worked only on the row that was selected. And when he
> went to another row, the formatting on the first row disappeared.
> 
> As I posted, I have a solution which is not ideal, as it does not give
> a visual cue that the optional frame is disabled. But I trapped a
> change to the option frame in the After Update event and if
> Me.fldTenantLeaseStepHeading = True, set the option frame back to its
> previous state.  So that satisfied the client. Which is usually wher I
> stop developing. :o)
> 
> r
> 
> 
> 
> On Sun, Jan 14, 2024 at 11:18AM John Colby <jwcolby at gmail.com>
> wrote:
> 
> > Rocky, is the field true for every record?  It feels like there
> > should be an else which sets enabled to true.
> >
> > Did you watch the youtube video for that part where the presenter
> > discussed what he was doing.
> >
> > On Sat, Jan 13, 2024 at 8:58PM Rocky Smolin
> > <rockysmolin2 at gmail.com> wrote:
> >
> > > I tried it with:
> > >
> > >     Private Sub Detail_Paint()
> > >     If Me.fldTenantLeaseStepHeading = True Then
> > > Me.fldTenantLeaseStepUrgency.Enabled = False
> > > End Sub
> > >
> > > and it turned the urgency field false for all the records.
> > >
> > > r
> > >
> > > On Sat, Jan 13, 2024 at 4:44PM Stuart McLachlan
> > > <stuart at lexacorp.com.pg
> > >
> > > wrote:
> > >
> > > > You can try to use it, but unless you are just changing control
> > colours,
> > > > you'll probably either
> > > > get a Compile error: Invalid use of property
> > > > or
> > > > Error 32521: You can't change the value of this property in the
> > > > OnPaint event. or
> > > >  constant redraws and flickering and possibly an unresposnive
> > > >  form.
> > > >
> > > >
> > > >
> > > >
> > > > On 13 Jan 2024 at 19:16, John Colby wrote:
> > > >
> > > > > OK, my apologies, it is the OnPaint event.
> > > > >
> > > > > Youtube video which toggles background color of a record in
> > continuous
> > > > > <
> > https://www.youtube.com/watch?v=Y2t0JDeFpR4&list=PLwIULo1M2EWukaR2n0
> > S
> > > > > T44ajp9_LsLOLa&index=9&t=3135s>
> > > > >
> > > > > at time 47:03
> > > > >
> > > > > On Sat, Jan 13, 2024 at 5:54PM Stuart McLachlan
> > > > > <stuart at lexacorp.com.pg> wrote:
> > > > >
> > > > > > I can't find an OnFormat  event anywhere on a bound
> > > > > > continuous form in Access 2021 ( Not for Form, Detail or a
> > > > > > Control) . Where is it?
> > > > > >
> > > > > > On 13 Jan 2024 at 13:08, John Colby wrote:
> > > > > >
> > > > > > > I discovered the other day that there is an OnFormat event
> > > > > > > which fires for every line of a continuous form.  In that
> > > > > > > you can liik at the value of a field in that record and do
> > > > > > > stuff...  You might want to investigate doing it this way?
> > > > > > >
> > > > > > > On Sat, Jan 13, 2024 at 12:17PM Rocky Smolin
> > > > > > > <rockysmolin2 at gmail.com> wrote:
> > > > > > >
> > > > > > > > Well, it's a continuous form so if the user selects a
> > > > > > > > header record, then all the option groups would turn
> > > > > > > > disabled. A bit confusing for them.
> > > > > > > >
> > > > > > > > What I did was put code in wherever this option group
> > > > > > > > appears:
> > > > > > > >
> > > > > > > > Private Sub fldTenantLeaseStepUrgency_Click()
> > > > > > > >     If Me.fldTenantLeaseStepHeading = True Then
> > > > > > > > Me.fldTenantLeaseStepUrgency = Null
> > > > > > > > End Sub
> > > > > > > >
> > > > > > > > Now the header record has a pale purple background so
> > > > > > > > it's obvious looking at the list of steps which ones are
> > > > > > > > headers.
> > And
> > > > > > > > so there's no reason to ever click on that field. But if
> > > > > > > > they
> > do
> > > > > > > > nothing happens. And hopefully at that point they'll
> > > > > > > > think "D'oh. That is a header record, stupid.  Why am I
> > > > > > > > trying to select an urgency?"
> > > > > > > >
> > > > > > > > (Users (sigh). You never know what they're going to do
> > next...")
> > > > > > > > r
> > > > > > > >
> > > > > > > > On Thu, Jan 11, 2024 at 6:54PM Charlotte Foust
> > > > > > > > <charlotte.foust at gmail.com
> > > > > > > > >
> > > > > > > > wrote:
> > > > > > > >
> > > > > > > > > Hide a disabled (empty datasource) option group on the
> > > > > > > > > header in the same location as the active one. Toggle
> > > > > > > > > visibility in the OnCurrent event of
> > > > > > > > the
> > > > > > > > > form.
> > > > > > > > >
> > > > > > > > > Charlotte Foust
> > > > > > > > > (916) 206-4336
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > On Wed, Jan 10, 2024 at 7:29AM Rocky Smolin
> > > > > > > > > <rockysmolin2 at gmail.com> wrote:
> > > > > > > > >
> > > > > > > > > > Yes, that would work if the user tried to change the
> > urgency
> > > > > > > > > > on a
> > > > > > > > header
> > > > > > > > > > record. But only when that record on the continuous
> > > > > > > > > > form is selected.
> > > > > > > > > >
> > > > > > > > > > The client wants a visual cue that the urgency field
> > > > > > > > > > is not disabled.
> > > > > > > > > >
> > > > > > > > > > (Clients...you never know what they´re going to ask
> > > > > > > > > > for next...)
> > > > > > > > > >
> > > > > > > > > > R
> > > > > > > > > >
> > > > > > > > > > On Tue, Jan 9, 2024 at 11:51PM Gustav Brock via
> > > > > > > > > > AccessD < accessd at databaseadvisors.com> wrote:
> > > > > > > > > >
> > > > > > > > > > > Hi Rocky
> > > > > > > > > > >
> > > > > > > > > > > Maybe you, at the OnCurrent event, could lock the
> > > > > > > > > > > option group if the record is a heading?
> > > > > > > > > > >
> > > > > > > > > > > /gustav
> > > > > > > > > > >
> > > > > > > > > > > ________________________________
> > > > > > > > > > > Fra: AccessD
> > > > > > > > > > > <accessd-bounces+gustav=cactus.dk at databaseadvisors
> > > > > > > > > > > .com>
> > > > > > > > > på
> > > > > > > > > > > vegne af Rocky Smolin <rockysmolin2 at gmail.com>
> > > > > > > > > > > Sendt: 10. januar 2024 00:27 Til: Off Topic
> > > > > > > > > > > <dba-ot at databaseadvisors.com>; Access Developers
> > > > > > > > > > > discussion and problem solving
> > > > > > > > > > > <accessd at databaseadvisors.com> Emne: [AccessD]
> > > > > > > > > > > Disabling an Option Group
> > > > > > > > > > >
> > > > > > > > > > > Dear List:
> > > > > > > > > > >
> > > > > > > > > > > I have a continuous form with a procedure - series
> > > > > > > > > > > of steps. Some of
> > > > > > > > > > those
> > > > > > > > > > > records are "Headings" - not operational steps.
> > > > > > > > > > > Each step also has a priority or urgency field
> > > > > > > > > > > which is an option group with five option buttons.
> > > > > > > > > > >
> > > > > > > > > > > I have used conditional formatting to make the
> > > > > > > > > > > background of the
> > > > > > > > fields
> > > > > > > > > > of
> > > > > > > > > > > the heading lines purple - non-heading line fields
> > > > > > > > > > > are white.
> > > > > > > > > > >
> > > > > > > > > > > Client now would like to have the option group on
> > > > > > > > > > > the heading lines disabled. But conditional
> > > > > > > > > > > formatting
> > doesn't
> > > > > > > > > > > appear to be an option
> > > > > > > > for
> > > > > > > > > > an
> > > > > > > > > > > option group. (At least not in Access 2010, which
> > > > > > > > > > > is what I'm using.)
> > > > > > > > > > >
> > > > > > > > > > > I'm going to give him the bad news that option
> > > > > > > > > > > groups don't support conditional formatting. He'll
> > > > > > > > > > > be OK with that.
> > > > > > > > > > >
> > > > > > > > > > > But...does anyone have any clever or kludgey ideas
> > > > > > > > > > > to
> > give
> > > > > > > > > > > him what
> > > > > > > > he
> > > > > > > > > > > wants?
> > > > > > > > > > >
> > > > > > > > > > > MTIA
> > > > > > > > > > >
> > > > > > > > > > > r
> > > > > > > > > > > --
> > > > > > > > > > > AccessD mailing list
> > > > > > > > > > > AccessD at databaseadvisors.com
> > > > > > > > > > > https://databaseadvisors.com/mailman/listinfo/acce
> > > > > > > > > > > ssd Website: http://www.databaseadvisors.com
> > > > > > > > > > >
> > > > > > > > > > --
> > > > > > > > > > AccessD mailing list
> > > > > > > > > > AccessD at databaseadvisors.com
> > > > > > > > > > https://databaseadvisors.com/mailman/listinfo/access
> > > > > > > > > > d Website: http://www.databaseadvisors.com
> > > > > > > > > >
> > > > > > > > > --
> > > > > > > > > AccessD mailing list
> > > > > > > > > AccessD at databaseadvisors.com
> > > > > > > > > https://databaseadvisors.com/mailman/listinfo/accessd
> > > > > > > > > Website: http://www.databaseadvisors.com
> > > > > > > > >
> > > > > > > > --
> > > > > > > > AccessD mailing list
> > > > > > > > AccessD at databaseadvisors.com
> > > > > > > > https://databaseadvisors.com/mailman/listinfo/accessd
> > > > > > > > Website: http://www.databaseadvisors.com
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > --
> > > > > > > John W. Colby
> > > > > > > Colby Consulting
> > > > > > > --
> > > > > > > AccessD mailing list
> > > > > > > AccessD at databaseadvisors.com
> > > > > > > https://databaseadvisors.com/mailman/listinfo/accessd
> > > > > > > Website: http://www.databaseadvisors.com
> > > > > >
> > > > > >
> > > > > > --
> > > > > > AccessD mailing list
> > > > > > AccessD at databaseadvisors.com
> > > > > > https://databaseadvisors.com/mailman/listinfo/accessd
> > > > > > Website: http://www.databaseadvisors.com
> > > > > >
> > > > >
> > > > >
> > > > > --
> > > > > John W. Colby
> > > > > Colby Consulting
> > > > > --
> > > > > AccessD mailing list
> > > > > AccessD at databaseadvisors.com
> > > > > https://databaseadvisors.com/mailman/listinfo/accessd
> > > > > Website: http://www.databaseadvisors.com
> > > >
> > > >
> > > > --
> > > > AccessD mailing list
> > > > AccessD at databaseadvisors.com
> > > > https://databaseadvisors.com/mailman/listinfo/accessd
> > > > Website: http://www.databaseadvisors.com
> > > >
> > > --
> > > AccessD mailing list
> > > AccessD at databaseadvisors.com
> > > https://databaseadvisors.com/mailman/listinfo/accessd
> > > Website: http://www.databaseadvisors.com
> > >
> >
> >
> > --
> > John W. Colby
> > Colby Consulting
> > --
> > AccessD mailing list
> > AccessD at databaseadvisors.com
> > https://databaseadvisors.com/mailman/listinfo/accessd
> > Website: http://www.databaseadvisors.com
> >
> -- 
> AccessD mailing list
> AccessD at databaseadvisors.com
> https://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com




More information about the AccessD mailing list