Results 1 to 2 of 2
  1. #1
    TinaCa is offline Advanced Beginner
    Windows Vista Access 2010 32bit
    Join Date
    Jul 2011
    Posts
    87

    Open report filter from form getting error message

    This so easy but I keep getting a weird error message.



    Here is the code to open the report.

    DoCmd.OpenReport "rptCrewCompanies", acViewPreview, , [CrewMemberId] = Me.cboWorker.Column(0)

    I get the error message -

    ....can't find thefield '|1' referred to in your expression.

    I should mention if i change [] to " " the report returns no records.

    I swear folks I can't find |1 anywhere

  2. #2
    ssanfu is offline Master of Nothing
    Windows 2K Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Try

    Code:
    DoCmd.OpenReport "rptCrewCompanies", acViewPreview, , "[CrewMemberId] =  " & Me.cboWorker.Column(0)
    if Me.cboWorker.Column(0) is a number. If it is text, try

    Code:
    DoCmd.OpenReport "rptCrewCompanies", acViewPreview, , "[CrewMemberId] =  '" &  Me.cboWorker.Column(0) & "'"

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 3
    Last Post: 07-13-2011, 02:04 PM
  2. Filter and Open Report in Runtime
    By ggs in forum Access
    Replies: 3
    Last Post: 06-28-2011, 03:02 AM
  3. filter when i open form
    By Balen in forum Forms
    Replies: 0
    Last Post: 08-12-2010, 02:31 PM
  4. Replies: 3
    Last Post: 11-22-2009, 07:46 AM
  5. How to open a form with filter applied?
    By rkm360 in forum Access
    Replies: 1
    Last Post: 03-18-2009, 09:27 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums