Results 1 to 2 of 2
  1. #1
    halnurse is offline Novice
    Windows XP Access 2007
    Join Date
    Jun 2016
    Posts
    22

    Error when filtering column in subform using unbound text box

    Hello all! I am trying to filter a column (PPO#) in a subform using an unbound text box and a button. The subform (frmAssignPO#) is on the second page of a tab control (this page is called pgMaterial). My code for the On Click (Where Condition) is as follows:
    [PPO#] Like "*" & [frmAssignPO#].[Form]![PPO_Filter_txt] &"*"

    The text box is called PPO_Filter_txt.

    I get an error when I try to filter using this code that says my form isn't bound to a query however I have the RecordSource property filled out and pointing to a query called qryAssignPO#. Anybody know what I am doing wrong or another way to filter this column? Thanks for your time.

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    That can't be your actual code (or at least it won't even compile). Something like:

    Forms!MainFormName.[frmAssignPO#].Form.Filter = "[PPO#] Like "'*" & Forms!MainFormName.[frmAssignPO#].[Form]![PPO_Filter_txt] & "*'"
    Forms!MainFormName.[frmAssignPO#].Form.FilterOn =True

    Having spaces or symbols in your object names isn't a good idea. Forces you to bracket them all.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Unbound Calculated Text Box Error #Name?
    By SierraJuliet in forum Programming
    Replies: 18
    Last Post: 01-25-2018, 06:54 PM
  2. Text Filtering from a Datasheet Column
    By emhill57 in forum Access
    Replies: 1
    Last Post: 08-23-2017, 10:32 AM
  3. Replies: 6
    Last Post: 02-12-2016, 07:20 PM
  4. Avg a column of unbound text boxes
    By JRT2006 in forum Forms
    Replies: 6
    Last Post: 05-08-2015, 10:32 AM
  5. Unbound Text Box to Subform
    By blocksey in forum Access
    Replies: 1
    Last Post: 03-27-2014, 07:19 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