<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META content="MSHTML 5.50.4923.2500" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><SPAN class=183400112-28072003><FONT face=Arial color=#0000ff
size=2>Pedro,</FONT></SPAN></DIV>
<DIV><SPAN class=183400112-28072003><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=183400112-28072003><FONT face=Arial color=#0000ff size=2>We
should really know the whole picture so that the code doesn't need to be
rewritten each time you give us a new piece of information. Anyway, t<SPAN
class=183400112-28072003><FONT face=Arial color=#0000ff size=2>his should get
you there (with some minor tweaks). </FONT></SPAN>Watch out for line wrapping in
the e-mail...</FONT></SPAN></DIV>
<DIV><SPAN class=183400112-28072003><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=183400112-28072003><FONT face=Arial color=#0000ff size=2>Dim
strNumbers As String, strNumber As String<BR>Dim intLoc As Integer, intNumber As
Integer<BR>Dim bolFound As Boolean</FONT></SPAN></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<DIV><SPAN class=183400112-28072003><FONT face=Arial color=#0000ff
size=2>bolFound = False<BR>For intNumber = 1 To 5 ' Build a string
that represents each checked Product Code<BR> If
Me("chbProductCode" & intNumber) = True
Then<BR> strNumbers = strNumbers &
intNumber & ";"<BR> bolFound =
True<BR> End If<BR>Next intNumber</FONT></SPAN></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<DIV><SPAN class=183400112-28072003><FONT face=Arial color=#0000ff size=2>If
bolFound = True Then<BR> strNumbers = Left(strNumbers,
Len(strNumbers) - 1)<BR>End If</FONT></SPAN></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<DIV><SPAN class=183400112-28072003><FONT face=Arial color=#0000ff size=2>While
bolFound = True<BR> intLoc = InStr(strNumbers,
";")<BR></FONT></SPAN></DIV>
<DIV><SPAN class=183400112-28072003><FONT face=Arial color=#0000ff
size=2> If intLoc > 0 Then ' see if the are more than one
to deal with<BR> ' There are more than
one so, parse out individual numbers</FONT></SPAN></DIV>
<DIV><SPAN class=183400112-28072003><FONT face=Arial color=#0000ff
size=2> strNumber = Left(strNumbers,
intLoc - 1)<BR> strNumbers =
Right(strNumbers, Len(strNumbers) - intLoc)<BR>
Else<BR> ' This is the last
one</FONT></SPAN></DIV>
<DIV><SPAN class=183400112-28072003><FONT face=Arial color=#0000ff
size=2> strNumber =
strNumbers<BR> bolFound =
False<BR> End If<BR></DIV></FONT></SPAN>
<DIV><SPAN class=183400112-28072003><FONT face=Arial color=#0000ff
size=2> .Item("ProductCode" & strNumber).Value =
Nz(Me("txtProductCode" & _<BR>
strNumber))<BR> .Item("Number" & strNumber).Value =
Nz(Me![txtNumber])</FONT></SPAN></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<DIV><SPAN class=183400112-28072003><FONT face=Arial color=#0000ff
size=2> 'You need to change this for what you are
doing<BR> If chbA1 = True
Then<BR> .Item("Price" &
strNumber).Value = Nz(Me("txt" &
_<BR>
strNumber & "c16"))<BR> ElseIf chbA2 = True
Then<BR> .Item("Price" &
strNumber).Value = Nz(Me("txt" &
_<BR>
strNumber & "c17"))<BR> ElseIf chbA3 = True
Then<BR> .Item("Price" &
strNumber).Value = Nz(Me("txt" &
_<BR>
strNumber & "c18"))<BR> ElseIf chbUitz1 = True
Then<BR> .Item("Number" &
strNumber).Value = Nz(Me("txtUitz" &
_<BR>
strNumber & "Number"))<BR>
.Item("Price" & strNumber).Value = Nz(Me("txtUitz" &
_<BR>
strNumber & "Price"))<BR> End
If<BR>Wend<BR></FONT></SPAN></DIV>
<DIV><SPAN class=183400112-28072003></SPAN><SPAN
class=183400112-28072003></SPAN><SPAN class=183400112-28072003><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=183400112-28072003><FONT face=Arial color=#0000ff
size=2>Scott</FONT></SPAN></DIV>
<DIV><SPAN class=183400112-28072003><FONT face=Arial color=#0000ff
size=2> </DIV></FONT></SPAN>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
<DIV class=OutlookMessageHeader dir=ltr align=left><FONT face=Tahoma
size=2>-----Original Message-----<BR><B>From:</B> Pedro Janssen
[mailto:pedro@plex.nl]<BR><B>Sent:</B> Saturday, July 26, 2003 10:22
AM<BR><B>To:</B> AccessD@databaseadvisors.com<BR><B>Subject:</B> [AccessD]
select more then one<BR><BR></FONT></DIV>
<DIV><FONT face=Arial size=2>Hello Group,</FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>with the code below i get as result: One
Produktcode, One number and One price depending on which
checkboxProduktcode is selected.</FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Is there a way to change this code so that i
could select more then one checkboxProduktcode (still only one of the chbA1,
chbA2, chbA3 or chbUitz1can be selected) and that the outcome would be the
selected produktcodes with there numbers and prices</FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>TIA</FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Pedro Janssen</FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>Dim strNumber as String<BR>Dim bolFound as
Boolean<BR><BR>bolFound = False<BR>If chbProductCode1 = true
then<BR> strNumber = "1"<BR> bolFound =
True<BR>ElseIf chbProductCode2 = true then<BR> strNumber =
"2"<BR> bolFound = True</FONT></DIV>
<DIV><FONT face=Arial size=2>ElseIf chbProductCode3 = true
then<BR> strNumber = "3"<BR> bolFound =
True<BR>ElseIf chbProductCode4 = true then<BR> strNumber =
"4"<BR> bolFound = True<BR>ElseIf chbProductCode5 = true
then<BR> strNumber = "5"<BR> bolFound =
True<BR><BR>EndIf<BR><BR>If bolFound = True then<BR>
.Item("ProductCode" & strNumber).Value = Nz(Me("txtProductCode" &
_<BR>
strNumber))<BR> .Item("Number" & strNumber).Value =
Nz(Me![txtNumber])<BR> <BR> If chbA1 =
True then<BR> .Item("Price" &
strNumber).Value = Nz(Me("txt" &
_<BR>
strNumber & "c16"))<BR> ElseIf chbA2 = True
then<BR> .Item("Price" &
strNumber).Value = Nz(Me("txt" &
_<BR>
strNumber & "c17"))<BR> ElseIf chbA3 = True
then<BR> .Item("Price" &
strNumber).Value = Nz(Me("txt" &
_<BR>
strNumber & "c18"))<BR> ElseIf chbUitz1 = True
then<BR> .Item("Number" &
strNumber).Value = Nz(Me("txtUitz" &
_<BR>
strNumber & "Number"))<BR>
.Item("Price" & strNumber).Value = Nz(Me("txtUitz" &
_<BR>
strNumber & "Price"))<BR> End If<BR>End
If<BR></DIV></BLOCKQUOTE></FONT></BODY></HTML>