[AccessD] IF ...... ELSEIF

Pedro Janssen pedro at plex.nl
Mon Mar 24 16:07:56 CST 2003


Hello Group,

The code below is a part of a code that i use to make 
wordletters with data from access2K.

 If chb1 = True and chb1A = True then
    prps.Item("Name").Value = Nz(Me![txtName1])
    prps.Item("Adress").Value = Nz(Me![txtAddress1])
    prps.Item("Part1A").Value = Nz(Me![txtPart1A])
    prps.Item("ZkFonds1A").Value = Nz(Me![txtZkFonds1A])

   ElseIf chb1 = True and chb1B = True then
    prps.Item("Name").Value = Nz(Me![txtName1])
    prps.Item("Adress").Value = Nz(Me![txtAddress1])
    prps.Item("Part1B").Value = Nz(Me![txtPart1B])
    prps.Item("ZkFonds1B").Value = Nz(Me![txtZkFonds1B])
 
ElseIf  chb2 = True and chb2A = True then 
    prps.Item("Name").Value = Nz(Me![txtName2])
    prps.Item("Adress").Value = Nz(Me![txtAddress2])
    prps.Item("Part2A").Value = Nz(Me![txtPart2A])
    prps.Item("ZkFonds2A").Value = Nz(Me![txtZkFonds2A]) 

ElseIf chb2 = True and chb2B = True then 
    prps.Item("Name").Value = Nz(Me![txtName2])
    prps.Item("Adress").Value = Nz(Me![txtAddress2])
    prps.Item("Part2B").Value = Nz(Me![txtPart2B])
    prps.Item("ZkFonds2B").Value = Nz(Me![txtZkFonds2B])
 
End If
 
 
because i have lots of fields and lots of checkboxes its a hell
of a job to type, or copy/paste and change all this.
I know the code below isn't working, but is there a way to modifie
the code to something like


 If chb1 = True then
    prps.Item("Name").Value = Nz(Me![txtName1])
    prps.Item("Adress").Value = Nz(Me![txtAddress1])
 
AND chb2A = True Then
    prps.Item("Part1A").Value = Nz(Me![txtPart1A])
    prps.Item("ZkFonds1A").Value = Nz(Me![txtZkFonds1A])
AND chb2B = True Then
    prps.Item("Part1B").Value = Nz(Me![txtPart1B])
    prps.Item("ZkFonds1B").Value = Nz(Me![txtZkFonds1B])
 

ElseIf If chb2 = True then 
    prps.Item("Name").Value = Nz(Me![txtName2])
    prps.Item("Adress").Value = Nz(Me![txtAddress2])
 
AND chb2A = True Then
    prps.Item("Part2A").Value = Nz(Me![txtPart2A])
    prps.Item("ZkFonds2A").Value = Nz(Me![txtZkFonds2A])
AND chb2B = True Then
    prps.Item("Part2B").Value = Nz(Me![txtPart2B])
    prps.Item("ZkFonds2B").Value = Nz(Me![txtZkFonds2B])
 
End If
 
TIA
 
Pedro Janssen
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://databaseadvisors.com/pipermail/accessd/attachments/20030324/6fe2fe71/attachment.html>


More information about the AccessD mailing list