Filter report using form filter

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • phill86
    New Member
    • Mar 2008
    • 121

    Filter report using form filter

    Hi,

    I am filtering a report using the form filter with the following code

    Code:
    DoCmd.OpenReport "report1", acViewReport, , Me.filter
    Which works fine untill I filter the form on one of the fields which is a lookup field
    and I get the enter parameter value box which is looking for the Assetdetails.de tails field which contains the following text for some reason it has put Lookup_ at the front of the field

    Lookup_AssetDet ails.Details
    I think that the because the lookup field actually stores the ID number rather than the text in the form

    When I open the form in design view in the filter property it contains the following string

    ([Lookup_AssetDet ails].[Details]="AKG C414 Microphone Condenser")
    Is there anyway around this problem?

    regards Phill
  • ChipR
    Recognized Expert Top Contributor
    • Jul 2008
    • 1289

    #2
    You could probably use:
    Code:
    Replace(Me.filter, "Lookup_", "")

    Comment

    • NeoPa
      Recognized Expert Moderator MVP
      • Oct 2006
      • 32633

      #3
      Perhaps if you explained exactly what you're trying to do (Give some more detail as we cannot check out what you're talking about by looking at the database - We don't have it).

      Is Details a lookup field? If so, what are the details? What's the name of the field you're really trying to filter on?

      We need some details even to understand the question properly, but certainly to provide a decent answer.

      Comment

      Working...