Results 1 to 8 of 8
  1. #1
    Join Date
    Apr 2012
    Posts
    22

    Unanswered: Access - searches the appintmentsID table fail

    Please help with this code, it searches the appintmentsID table and suppose to return results based on the ID you searched. It currently does not return anything, though i searched and ID that exists.



    Private Sub btnSearch_Click()
    Dim rs As Object
    Set rs = Me.RecordsetClone
    With rs
    If Nz(Me.txtSearch, "") <> "" Then
    .FindFirst "AppointmentID = " & Me.txtSearch
    If Not .NoMatch Then
    Me.Bookmark = .Bookmark
    Else
    MsgBox "No results for Appointment ID: " & Me.txtSearch
    End If
    Else
    MsgBox "Please enter an appointment ID"
    End If
    End With
    Set rs = Nothing
    End Sub

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    where is this code supposed to return anything?
    all I can see it do is something with a bookmark if something is found. at no point do I see where this bookmark is used. Ive not used bookmarks in years so Im not entirely certain, but I think you are not using the bookmakr property correctly.
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    Apr 2012
    Posts
    22
    How can i make it to return the data recored on the searched ID. What else can i use ? Seeing that bookmark does not help..Thanks again

  4. #4
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    Is AppointmentID defined as a number or as a text?
    Have a nice day!

  5. #5
    Join Date
    Apr 2012
    Posts
    22
    Dataype is Autonumber

  6. #6
    Join Date
    Apr 2012
    Posts
    22
    This is resolved - Larry Larsen helped me.

  7. #7
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    Glad you got the problem resolved! Forum etiquette here (and on all forums, actually) requires that you post the solution here. This makes the solution available to others who may come here, at a later date, looking for help with the same or similar problem.

    Linq ;0)>
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  8. #8
    Join Date
    Apr 2012
    Posts
    22
    Hi Missinglinq, yes i normally do but this time the solution involved redoing everything so i there was no specific code used that i can post here. Thanks

Posting Permissions

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