Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2002
    Posts
    8

    Red face Unanswered: retrieve records on report from field on a form

    I have an ADP database linked to SQL7. I have done a lookup on a form which provides information for a client on the key field [AccountNo].
    I want to open a report filtered on the [AccountNo].value that is on the form, but as I am new to ADO, I can't find an easy way to do it.
    I have gone round in circles with ServerFilter, InputParameter and even trying to write a reference to the form in SQL (which doesn't work as it would in an MDB query).

    I am embarrased to say that I can't figure out how to do this, and it's probably simple. (I hope).

    Regards
    Adrian

  2. #2
    Join Date
    Nov 2002
    Posts
    8

    Talking

    With the help of Allen Browne MVP, the solution is at hand. It is possible to get the information by putting:-

    Me.ServerFilter = (("[SomeField] = '" & [Forms]![OpenForm]![FieldIWant] & "'"))

    onto the reports onopen property

    Note:- The above is for values that do not contain an apostrophe. If your field may contain an apostrophe, then you will need to use a different format (See Access 2000 Developers handbook Vol 1, page 285)

    Thanks again Allen.

    Regards

    Adrian

Posting Permissions

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