Results 1 to 2 of 2

Thread: syntax issue

  1. #1
    Join Date
    Apr 2004
    ny, ny

    Unanswered: syntax issue

    checkoutList = "SELECT Checkouts.CheckoutID, Checkouts.IssuerName as [NAME], Checkouts.Tel as [TEL], as [EMAIL], checkouts.startdate as [DATE ISSUED], checkouts.enddate as [RETURN DATE]" & _

    dbCW.Execute ("UPDATE checkouts set [enddate] = #" & Date & "# where [checkoutid] ='" & checklist.checkoutID & "'")

    CheckoutID is autonumber
    There seems to be something wrong with the syntax, could someone help me out

    thank you

  2. #2
    Join Date
    Feb 2004
    If you are using a form to do this, then why can't you can include the checkin date in the forms recordsource and just enter the date in the form field? If you don't have access by a form field then you can do this with DAO.

    Update method like this.
     Sub UpdateRec()
    Dim rst As Recordset
    Dim recIndex As Integer
    Dim strQry As String
    recIndex = "'" & Me.checkoutID
    strQry = "SELECT checkouts.checkoutid, checkouts.enddate" & _
            " FROM [checkouts]" & _
            "WHERE (((checkouts.checkoutid)=" & recIndex & "))"
    Set rst = CurrentDb.OpenRecordset(strQry, dbOpenDynaset)
    With rst
        If .RecordCount = 1 Then
            If IsNull(![enddate]) Then
                ![enddate] = Now()
                MsgBox "Date Updated"
            End If
        MsgBox "A unique record Index for checkoutid# '" & recIndex & "' was not found"
        End If
    End With
    End Sub


Posting Permissions

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