[AccessD] select more then one

Jim DeMarco Jdemarco at hshhp.org
Sun Aug 24 05:17:23 CDT 2003


I think Pedro is correct.  Any reference to "i" should be changed to "inner".  Sorry.

Jim DeMarco

-----Original Message-----
From: Gustav Brock [mailto:gustav at cactus.dk]
Sent: Sunday, August 24, 2003 5:35 AM
To: Access Developers discussion and problem solving
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


***********************************************************************************
"This electronic message is intended to be for the use only of the named recipient, and may contain information from Hudson Health Plan (HHP) that is confidential or privileged.  If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or use of the contents of this message is strictly prohibited.  If you have received this message in error or are not the named recipient, please notify us immediately, either by contacting the sender at the electronic mail address noted above or calling HHP at (914) 631-1611. If you are not the intended recipient, please do not forward this email to anyone, and delete and destroy all copies of this message.  Thank You".
***********************************************************************************



More information about the AccessD mailing list