[AccessD] IF ...... ELSEIF

William Hindman wdhindman at bellsouth.net
Mon Mar 24 16:17:12 CST 2003


Pedro

...look up the SelectCase methods in your Help file ...HTH :)

William Hindman
"All it takes for evil to prevail is for good men to do nothing." Edmund Burke

  ----- Original Message ----- 
  From: Pedro Janssen 
  To: AccessD at databaseadvisors.com 
  Sent: Monday, March 24, 2003 5:07 PM
  Subject: [AccessD] IF ...... ELSEIF


  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



------------------------------------------------------------------------------


  _______________________________________________
  AccessD mailing list
  AccessD at databaseadvisors.com
  http://databaseadvisors.com/mailman/listinfo/accessd
  Website: http://www.databaseadvisors.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://databaseadvisors.com/pipermail/accessd/attachments/20030324/8a6a4e8b/attachment-0001.html>


More information about the AccessD mailing list