Results 1 to 3 of 3
  1. #1
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Can I Streamline This? (a2k (9.0.6926) SP-3 Jet 4.0 SP-8)

    The following code works OK

    How can I streamline statements 1, 2 and 3 into 1 statement line?

    Thanks, John


    <pre>' Get the last dues renewal
    Set rst = db.OpenRecordset("SELECT Top 1 * FROM tblCobraPayments " & _
    "WHERE lngCobraID = " & Me.Parent.lngCobraID & _
    " ORDER BY dtmPaidThru DESC")
    ' If there's a record
    If Not rst.EOF Then
    ' Save the member's last paid thru date

    1 Dim dtmNextDueDate As Date

    2 dtmNextDueDate = rst!dtmPaidThru

    3 Me.[Paid Thru] = DateAdd("m", 3, dtmNextDueDate)

    End If
    </pre>


  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Can I Streamline This? (a2k (9.0.6926) SP-3 Jet 4.0 SP-8)

    How about

    Me.[Paid Thru] = DateAdd("m", 3, rst!dtmPaidThru)

  3. #3
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Can I Streamline This? (a2k (9.0.6926) SP-3 Jet 4.0 SP-8)

    Thanks, that was a variation I didn

Posting Permissions

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