<!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></HEAD>
<BODY bgColor=#ffffff>
<DIV><SPAN class=569354511-21072003><FONT face=Arial color=#0000ff
size=2>Pedro,</FONT></SPAN></DIV>
<DIV><SPAN class=569354511-21072003><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=569354511-21072003><FONT face=Arial color=#0000ff size=2>It
sounds like you don't have one of the controls named properly. Check all your
controls and make sure they are named properly.</FONT></SPAN></DIV>
<DIV><SPAN class=569354511-21072003><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=569354511-21072003><FONT face=Arial color=#0000ff
size=2>Scott</FONT></SPAN></DIV>
<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 19, 2003 3:36
PM<BR><B>To:</B> Access Developers discussion and problem
solving<BR><B>Subject:</B> Re: Re: [AccessD] shorter and quicker
code<BR><BR></FONT></DIV>
<DIV><FONT face=Arial size=2>Hi Scott,</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>because i had 10 chbProductCode's i
placed</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>ElseIf chbProductCode3 = true
then<BR> strNumber = "3"<BR> bolFound =
True</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>etc. etc in the code.</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>chbProductCode 1 and 2 are working
fine.</FONT></DIV>
<DIV><FONT face=Arial size=2>From 3 i get an error.<BR></FONT></DIV>
<DIV><FONT face=Arial size=2>Error No: 5; Description: Invalid
procedure-calling or invalid argument</FONT></DIV>
<DIV><FONT face=Arial size=2>(I'll hope i have got the translation right,
because we are using Dutch versions)</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I can't figure out why this error
exists.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Pedro</DIV></FONT>
<DIV> </DIV>
<BLOCKQUOTE
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B>
<A title=tsm@zoomtown.com
href="mailto:tsm@zoomtown.com">tsm@zoomtown.com</A> </DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A
title=accessd@databaseadvisors.com
href="mailto:accessd@databaseadvisors.com">Access Developers discussion and
problem solving</A> </DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Saturday, July 19, 2003 12:49
AM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> Re: Re: [AccessD] shorter and
quicker code</DIV>
<DIV><BR></DIV>Pedro,<BR><BR>I was working off the top of my head and forgot
some stupid stuff so I fixed it. Also, this may be faster to write but it
will run slower.<BR><BR>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<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><BR>Scott<BR><BR> <BR><BR>From: <tsm@zoomtown.com><BR>Date:
2003/07/18 Fri PM 06:38:12 EDT<BR>To: Access Developers discussion and
problem solving<BR><accessd@databaseadvisors.com><BR>Subject: Re:
[AccessD] shorter and quicker code<BR><BR>Pedro,<BR><BR>Try the
following:<BR><BR>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<BR>EndIf<BR><BR>If bolFound = True
then<BR> .Item("ProductCode" & strNumber).Value =
Nz(Me![txtProductCode1])<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><BR>Scott<BR><BR>From: "Pedro Janssen" <pedro@plex.nl><BR>Date:
2003/07/18 Fri PM 05:31:35 EDT<BR>To:
<AccessD@databaseadvisors.com><BR>Subject: [AccessD] shorter and
quicker code<BR><BR>Hello Group,<BR><BR>the code below is part of a code
that i have to write in about five versions for 10 ProductCode's.<BR>This is
a lot of typing, copying, pasting and you can't let your mind slip away,
otherwise you make mistakes. Is there a shorter and quicker
way?<BR><BR>TIA<BR><BR>Pedro Janssen<BR><BR><BR>If chbProductCode1= True
then<BR> .Item("ProductCode1").Value =
Nz(Me![txtProductCode1])<BR> <BR> If
chbA1 = True then<BR>
.Item("Number1").Value =
Nz(Me![txtNumber])<BR>
.Item("Price1").Value = Nz(Me![txt1c16])<BR> ElseIf chbA2
= True then<BR>
.Item("Number1").Value =
Nz(Me![txtNumber])<BR>
.Item("Price1").Value = Nz(Me![txt1c17])<BR> ElseIf chbA3
= True then<BR>
.Item("Number1").Value =
Nz(Me![txtNumber])<BR>
.Item("Price1").Value = Nz(Me![txt1c18])<BR> ElseIf
chbUitz1 = True then<BR>
.Item("Number1").Value =
Nz(Me![txtUitz1Number])<BR>
.Item("Price1").Value = Nz(Me![txtUitz1Price])<BR> End
If<BR>End If<BR> <BR> <BR>If chbProductCode2= True
then<BR> .Item("ProductCode2").Value =
Nz(Me![txtProductCode2])<BR> <BR> If
chbA1 = True then<BR>
.Item("Number2").Value =
Nz(Me![txtNumber])<BR>
.Item("Price2").Value = Nz(Me![txt2c16])<BR> ElseIf chbA2
= True then<BR>
.Item("Number2").Value =
Nz(Me![txtNumber])<BR>
.Item("Price2").Value = Nz(Me![txt2c17])<BR> ElseIf chbA3
= True then<BR>
.Item("Number2").Value =
Nz(Me![txtNumber])<BR>
.Item("Price2").Value = Nz(Me![txt2c18])<BR> ElseIf
chbUitz2 = True then<BR>
.Item("Number2").Value =
Nz(Me![txtUitz2Number])<BR>
.Item("Price2").Value = Nz(Me![txtUitz2Price])<BR> End
If<BR>End
If<BR><BR><BR><BR><BR><BR><BR>_______________________________________________<BR>AccessD
mailing
list<BR>AccessD@databaseadvisors.com<BR>http://databaseadvisors.com/mailman/listinfo/accessd<BR>Website:
http://www.databaseadvisors.com<BR><BR><BR><BR>
<P>
<HR>
<P></P>
<META content="MSHTML 5.00.2920.0" name=GENERATOR>
<STYLE></STYLE>
<DIV><FONT face=Arial size=2>Hello Group,</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>the code below is part of a code that i have to
write in about five versions for 10 ProductCode's.</FONT></DIV>
<DIV><FONT face=Arial size=2>This is a lot of typing, copying, pasting and
you can't let your mind slip away, otherwise you make mistakes. Is there a
shorter and quicker way?</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>TIA</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>Pedro Janssen</FONT></DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>If chbProductCode1= True
then<BR> .Item("ProductCode1").Value =
Nz(Me![txtProductCode1])<BR> <BR> If
chbA1 = True
then<BR> .Item("Number1").Value =
Nz(Me![txtNumber])<BR>
.Item("Price1").Value = Nz(Me![txt1c16])<BR> ElseIf chbA2
= True then<BR>
.Item("Number1").Value =
Nz(Me![txtNumber])<BR>
.Item("Price1").Value = Nz(Me![txt1c17])<BR> ElseIf chbA3
= True then<BR>
.Item("Number1").Value =
Nz(Me![txtNumber])<BR>
.Item("Price1").Value = Nz(Me![txt1c18])</FONT></DIV>
<DIV><FONT face=Arial size=2> ElseIf chbUitz1 = True
then</FONT></DIV>
<DIV><FONT face=Arial size=2>
.Item("Number1").Value =
Nz(Me![txtUitz1Number])<BR>
.Item("Price1").Value = Nz(Me![txtUitz1Price])<BR> End
If<BR>End If</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>
<DIV><FONT face=Arial size=2>If chbProductCode2= True
then<BR> .Item("ProductCode2").Value =
Nz(Me![txtProductCode2])<BR> <BR> If
chbA1 = True
then<BR> .Item("Number2").Value =
Nz(Me![txtNumber])<BR>
.Item("Price2").Value = Nz(Me![txt2c16])<BR> ElseIf chbA2
= True then<BR>
.Item("Number2").Value =
Nz(Me![txtNumber])<BR>
.Item("Price2").Value = Nz(Me![txt2c17])<BR> ElseIf chbA3
= True then<BR>
.Item("Number2").Value =
Nz(Me![txtNumber])<BR>
.Item("Price2").Value = Nz(Me![txt2c18])</FONT></DIV>
<DIV><FONT face=Arial size=2> ElseIf chbUitz2 = True
then</FONT></DIV>
<DIV><FONT face=Arial size=2>
.Item("Number2").Value =
Nz(Me![txtUitz2Number])<BR>
.Item("Price2").Value = Nz(Me![txtUitz2Price])<BR> End
If<BR>End If<BR><BR></DIV></FONT><BR><BR></DIV></FONT>
<P>
<HR>
<P></P>_______________________________________________<BR>AccessD mailing
list<BR>AccessD@databaseadvisors.com<BR>http://databaseadvisors.com/mailman/listinfo/accessd<BR>Website:
http://www.databaseadvisors.com<BR><BR>
<P>
<HR>
<P></P>_______________________________________________<BR>AccessD mailing
list<BR>AccessD@databaseadvisors.com<BR>http://databaseadvisors.com/mailman/listinfo/accessd<BR>Website:
http://www.databaseadvisors.com<BR></BLOCKQUOTE></BLOCKQUOTE></BODY></HTML>