Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2004
    Posts
    2

    Unanswered: Filter form in VBA using multiple criteria

    Hi,

    I'm a novice in Access and need to filter a report by two criterias. Both work alone but when I connect them using AND I get an error message that would translate to English like "type mismatch". The code I use is

    Reports![GH].FilterOn = True

    Reports![GH].Filter = "[Material] = " & MaterialInt And "[Order] = " & OrderInt

    As I said both criteria work whithout the AND so the types must be compatibel.

    Any help or suggestions would be greatly appreciated!

    Thanks,
    Alex

  2. #2
    Join Date
    Jan 2003
    Location
    Aberdeen, Scotland, UK
    Posts
    168
    I think it could be a problem with the filter string. try:

    Reports![GH].Filter = "[Material] = " & MaterialInt & "And [Order] = " & OrderInt

    John
    J.

  3. #3
    Join Date
    Feb 2004
    Posts
    2
    John,

    perfect!!! Tried for hours yesterday and couldn't make it work. Works the way you wrote it down.

    Thanks a lot,
    Alex

Posting Permissions

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