Filter Report from Form -- Err Obj Doesn't Support this Property

  • Thread starter Thread starter Mike Thomas
  • Start date Start date
M

Mike Thomas

When I try to filter a report from a menu using either of the 2 methods
below, I receive the error "Object Does Not Support this Property or
Method".


Reports![Pack List Cont].Filter = "[copk] = " & Me.txt_copk
Reports![Pack List Cont].FilterOn = True

OR

DoCmd.OpenReport "Pack List Cont", acViewPreview, , "[copk] = " &
Me.txt_copk


Does anyone know the cause and the fix for this one?

Many thanks
Mike Thomas
 
What is the datatype of copk? If text then you must add delimiters like:

DoCmd.OpenReport "Pack List Cont", acViewPreview, ,
"[copk] = """ & Me.txt_copk & """"
 
Thanks Duane, the datatype of txt_copk is a long integer.

Mike Thomas
Duane Hookom said:
What is the datatype of copk? If text then you must add delimiters like:

DoCmd.OpenReport "Pack List Cont", acViewPreview, ,
"[copk] = """ & Me.txt_copk & """"

--
Duane Hookom
MS Access MVP


Mike Thomas said:
When I try to filter a report from a menu using either of the 2 methods
below, I receive the error "Object Does Not Support this Property or
Method".


Reports![Pack List Cont].Filter = "[copk] = " & Me.txt_copk
Reports![Pack List Cont].FilterOn = True

OR

DoCmd.OpenReport "Pack List Cont", acViewPreview, , "[copk] = " &
Me.txt_copk


Does anyone know the cause and the fix for this one?

Many thanks
Mike Thomas
 
Do you get the error with:
DoCmd.OpenReport "Pack List Cont", acViewPreview, , "[copk] = " &
Me.txt_copk
Do you get the error with
DoCmd.OpenReport "Pack List Cont", acViewPreview


--
Duane Hookom
MS Access MVP


Mike Thomas said:
Thanks Duane, the datatype of txt_copk is a long integer.

Mike Thomas
Duane Hookom said:
What is the datatype of copk? If text then you must add delimiters like:

DoCmd.OpenReport "Pack List Cont", acViewPreview, ,
"[copk] = """ & Me.txt_copk & """"

--
Duane Hookom
MS Access MVP


Mike Thomas said:
When I try to filter a report from a menu using either of the 2 methods
below, I receive the error "Object Does Not Support this Property or
Method".


Reports![Pack List Cont].Filter = "[copk] = " & Me.txt_copk
Reports![Pack List Cont].FilterOn = True

OR

DoCmd.OpenReport "Pack List Cont", acViewPreview, , "[copk] = " &
Me.txt_copk


Does anyone know the cause and the fix for this one?

Many thanks
Mike Thomas
 
Back
Top