Results 1 to 2 of 2
  1. #1
    4 Star Lounger
    Join Date
    Feb 2002
    Posts
    537
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Search for a date (Access 2000)

    With the help of Francois from the present Forum i have an excellent combo box for searching
    the dates :
    If IsNull(Me.Combo11) Then
    Me.Call_Listing_Subform.Form.Filter = ""
    Me.Call_Listing_Subform.Form.FilterOn = False
    Else
    Me.Call_Listing_Subform.Form.Filter = "[CallDate] = #" & Format(Me.Combo11, "dd/mm/yyyy") & "#"
    Me.Call_Listing_Subform.Form.FilterOn = True
    End If
    Me.Call_Listing_Subform.Form.Requery

    I want to add on another button to seek for a particular date.But the following
    code seems to be wrong since a syntax error is indicated

    Dim strDate As String
    Dim strBookmark As String
    strDate = InputBox("Please enter the date ")
    If strDate = "" Then
    Exit Sub
    End If
    Me.RecordsetClone.FindFirst "CallDate = " & strDate
    If Me.RecordsetClone.NoMatch Then
    MsgBox "calldate?" & strDate " Not Found!!"
    Me.Bookmark = strBookmark
    Else
    Me.Bookmark = Me.RecordsetClone.Bookmark
    End If


    May i have some help what is wrong with my code ?

  2. #2
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Search for a date (Access 2000)

    Replace the line :
    Me.RecordsetClone.FindFirst "CallDate = " & strDate
    with
    Me.RecordsetClone.FindFirst "CallDate = #" & strDate & "#"

    If this is to use in the form Calls from the database from <post#=417709>post 417709</post#>, this will not work as the form is unbouded. Just type the date in the combobox.
    Francois

Posting Permissions

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