Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2002
    Location
    Nottingham - UK
    Posts
    113

    Unhappy Unanswered: Binding 2 number fields...... Can this be done ?

    The problem - we have to search on two fields, one is page from - the other is page to.

    Example......

    Page 226 to Page 339 - but we will have to search for page 299, is it possible to search for this by binding the fields or is there an alternative way of doing this ?

    Thanks in advance !

  2. #2
    Join Date
    Apr 2003
    Location
    Santa Barbara, CA
    Posts
    67

    Re: Binding 2 number fields...... Can this be done ?

    Originally posted by donaldt
    The problem - we have to search on two fields, one is page from - the other is page to.

    Example......

    Page 226 to Page 339 - but we will have to search for page 299, is it possible to search for this by binding the fields or is there an alternative way of doing this ?

    Thanks in advance !
    I'm not sure I understand the problem, but let me give it a shot.

    Use an unbound text field for search criteria on your form. -> [SrchText]

    For "From"-"To": User would use format 226-339
    For single page: User would use format 299

    if instr([SrchText],"-") then 'case [SrchText] = "226-339"

    mark% = instr([srchText],"-")
    f(1)$ = left([SrchText],mark% - 1)
    f(2)$ = mid([SrchText]),mark%+1)

    cri$ = "[page] >= " & f(1)$ & " and [page] <= " & f(2)$

    else 'case [SrchText] = "299"

    cri$ = "[page] = " & [SrchText]

    endif

    To answer your question you can concatenate numbers by changing them to text. Use fix length formating so that the first 4 digits are the first page (From) and 5-8 are the (To) page places.

Posting Permissions

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