[AccessD] select more then one

Pedro Janssen pedro at plex.nl
Sun Aug 24 15:59:22 CDT 2003


Hello Gustav and Jim,

Option Explicit is always present in the declarations section of my modules.
So that can't be the reason for the error. Any other idea's why this error
can occur.

By the way, i think Gustav is correct. It must be a tough holiday because i
missed, i = inner.

Pedro




----- Original Message -----
From: "Gustav Brock" <gustav at cactus.dk>
To: "Access Developers discussion and problem solving"
<accessd at databaseadvisors.com>
Sent: Sunday, August 24, 2003 11:35 AM
Subject: Re: [AccessD] select more then one


> Hi Pedro
>
> Tough vacation/holiday?
>
> If you read the code there is an "inner".
> There's also an "i" ..
>
> What to do is left to you as a small after-vacation-exercise!
>
> Also, _always_ state
>
>   Option Explicit
>
> in the declarations section of every code module.
>
> /gustav
>
>
> > Hello Jim and rest of the group,
>
> > sorry for the late responce. I have been on holliday.
>
> > When i use the code you gave me, i get an compile error: Sub or Function
not defined.  Controls is selected.
> > I can't find the missing reference, or is there someting else wrong
>
> > Also i don't understand why jou use: Dim inner As Integer. There isn't
an: inner, in the code
>
> > Can You help me.
>
> > TIA
>
> > Pedro Janssen
> >   ----- Original Message -----
> >   From: Jim DeMarco
> >   To: Access Developers discussion and problem solving
> >   Sent: Friday, August 01, 2003 2:08 PM
> >   Subject: RE: [AccessD] select more then one
>
>
> >   How about something like this:
> >   <code>
> >   Function ShowHide(ctl as Control)
> >   Dim inner As Integer
> >   Dim outer as Integer
> >   Dim ShowIndex As Integer
> >   ShowIndex = Right(ctl.Name, 1)
> >   For  outer = 1 To 5
> >     For i = 1 To 26
> >         If outer = Cint(ShowIndex) Then
> >           Controls("Field" & ShowIndex & "_" & CStr(i)).Visible = True
> >         Else
> >           Controls("Field" & outer & "_" & CStr(i)).Visible = False
> >         End If
> >         'or
> >           Controls("Field" & outer & "_" & CStr(i)).Visible = (outer =
Cint(ShowIndex))
> >     Next inner
> >   Next outer
>
> >   End Function
> >   </code>
>
> >   or use this simplified version to replace the If block:
>
> >   <snip>
> >           Controls("Field" & outer & "_" & CStr(i)).Visible = (outer =
Cint(ShowIndex))
> >   </snip>
>
> >   Assuming chbProductcode1 through 5 are controls call this function
from each of the (chbProductcode1) click or change event passing in the name
of the calling control:
>
> >   <usage>
> >   Sub chbProductcode1_Click()
> >     ShowHide(chbProductcode1)
> >   End Sub
> >   </usage>
> >   HTH,
>
> >   Jim DeMarco
> >   Director of Product Development
> >   HealthSource/Hudson Health Plan
>
> _______________________________________________
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>



More information about the AccessD mailing list