Results 1 to 2 of 2

Thread: URGENT SEARCH

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Apr 2000
    Posts
    19

    Talking

    Can anyone help using the below code on button click, if it does not find a record it will show me a blank record, how would I let the user know the search criteria was not found and then move to the first record.


    <CODE?
    lastposition = Trim(InputBox("Enter Company for search."))
    criteria = "COMP_NAME Like '" & lastposition & "%'"
    frmCompany.rsmaster.Find criteria


    thank you in advance
    Daryl
    Daryl Collins

  2. #2

    Searcing and Repositioning

    Code:
    Dim varLastRecordBM as variant ' BookMark
    Dim lngIDToFind as variant
    TryAgain:
    lngIDToFind = Inputbox("RecordID to find?")
    
    if Len(lngIDToFind) = 0 then Exit Sub
    if Not IsNumeric(lngIDToFind) then 
      msgbox "You must supply a number.", vbinformation
      Goto TryAgain
    end if
    lngIDToFind = clng(lngIDToFind)
    
    varLastRecordBM = ors.BookMark
    ors.Find "ID=" & lngIDToFind
    If ors.EOF Then
      msgbox "ID not found.", vbinformation
      ors.BookMark = varLastRecordBM ' or ors.movefirst
    else
      ' msgbox "ID found.", vbinformation
      ...
    End If
    Hope this helps.
    Senior Systems Architect/Programmer

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