[AccessD] Disabling an Option Group
Rocky Smolin
rockysmolin2 at gmail.com
Sun Jan 14 22:05:09 CST 2024
I knew it was looking for the control. That the control had the same name
as the field shouldn't interfere with access finding the control. so why
couldn't it find the control? That BTW occurred after about 30 triggers of
the On Paint module.
r
On Sun, Jan 14, 2024 at 4:26 PM Stuart McLachlan <stuart at lexacorp.com.pg>
wrote:
> You just did have that problem! You couldn't differentiate between the
> recordset field and a
> missing control. :)
>
> You didn't realise that "couldn't find fldTenantLeaseStepHeading" was
> looking for a missing
> control, not that the field was missing.
>
> On 14 Jan 2024 at 15:52, Rocky Smolin wrote:
>
> > I always usf 'fld' prefix in the table followed by the table name and
> > then the field name. And I name the control the same as the field's
> > name. Never had a problem with that. Clean livin', I guess. In that
> > way when I'm looking at the code I can easily see the field name and
> > the table it came from - makes the code more self-documenting.
> >
> > r
> >
> > On Sun, Jan 14, 2024 at 1:39PM Stuart McLachlan
> > <stuart at lexacorp.com.pg> wrote:
> >
> > > That's why I hate the way Access names a control with its underlying
> > > field name.
> > >
> > > It can often create these sorts of traps for developers.
> > >
> > > I always rename them with the "correct" prefix i.e.
> > > chkTenantLeaseStepHeading etc
> > >
> > > (And I never use a superfluous prefix for fields in a table :) )
> > >
> > >
> > >
> > > On 15 Jan 2024 at 7:33, Stuart McLachlan wrote:
> > >
> > > > That won't work with a recordset field.
> > > > Do you have a control (textbox, checkbox or whatever) with that
> > > > name? If not, put a hidden one on the form.
> > > >
> > > > On 14 Jan 2024 at 13:18, Rocky Smolin wrote:
> > > >
> > > > > I tried
> > > > >
> > > > > Private Sub Detail_Paint()
> > > > > If Me.fldTenantLeaseStepHeading = True Then
> > > > > Me.fldTenantLeaseStepUrgency.Enabled = False ELSE
> > > > > Me.fldTenantLeaseStepUrgency.Enabled = True
> > > > > End Sub
> > > > >
> > > > > I turned the option group control in all the record to disabled,
> > > > > and then errors that it couldn't find fldTenantLeaseStepHeading.
> > > > >
>
> --
> 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