Results 1 to 5 of 5

Thread: Is there an easier way to code this??

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2004
    Posts
    12

    Is there an easier way to code this??

    Easier way of coding this??

    If (Rec1.Fields("original_clock_number").Value Is System.DBNull.Value) Then
       If (Rec1.Fields("new_clock_number").Value Is System.DBNull.Value) Then
          KronosWebString = KronosWebString & "&_f88:=1"
       Else
          KronosWebString = KronosWebString & "&_f88:1=" & Rec1.Fields("new_clock_number").Value
       End If
    Else
       If (Rec1.Fields("new_clock_number").Value Is System.DBNull.Value) Then
          KronosWebString = KronosWebString & "&_f88:1="
       Else
          If Rec1.Fields("original_clock_number").Value = Rec1.Fields("new_clock_number").Value Then
             KronosWebString = KronosWebString & "&_f88:1="
          Else
             KronosWebString = KronosWebString & "&_f88:1=" & Rec1.Fields("new_clock_number").Value
          End If
       End If
    End If

  2. #2
    Lively Member
    Join Date
    Dec 2003
    Posts
    91
    that looks like what it has to be... sorry man!

  3. #3
    Frenzied Member
    Join Date
    Feb 2003
    Location
    Argentina
    Posts
    1,950
    It looks like
    VB Code:
    1. KronosWebString = KronosWebString & "&_f88:=1"
    is the default, or most likely, condition. Why not set KronosWebString to that value, then test only for the couple alternatives?
    BTW, it was nice of you to format your code as text, spaces and all, but when I went to quote the code, all kinds of text formatting codes showed up. If you're using more than a line or two of code, please use the code format tags. You dont't have to click the VB button in the vB code line of the forum. That doesn't work so well for blocks of code. If you preface your code with [vb_code] and end it with [/Highlight], it's a lot easier for people to read. Remove the underscore from vb_code. though, that's a posting issue.
    Last edited by salvelinus; Apr 14th, 2004 at 07:28 PM.

  4. #4
    Frenzied Member
    Join Date
    Nov 2003
    Posts
    1,489
    it would be easier to read if you use {vbcode}{/vbcode} tags.

    I probably would have opted for a Select Case block in this case. It pretties it up a little better

  5. #5
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729
    Code:
    KronosWebString = KronosWebString & "&_f88:1=" & Rec1.Fields("new_clock_number").Value
    KronosWebString &= "&_f88:1=" & Rec1.Fields("new_clock_number").Value
    \m/\m/

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width