Results 1 to 7 of 7
  1. #1
    Mike4172 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2012
    Posts
    17

    Query Critera w/ two Paths

    I have setup a query where I require a Textbox to match a Field in a Query. Problem is the query is ran from a subform. I have two possible paths to subform. How do I set the criteria so that it takes a certain path depending on what the parent form is? I've tried using OR between the two but it'll give me a parameter prompt which I don't want.



    Current setup paths:

    [Forms]![TicketNO1]![Paw5]![OldTickNo]

    [Forms]![Clients5]![Paw5]![OldTickNo]

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,921
    Don't think you can.

    What do you mean 'query is run from subform'? You are opening a query object? I don't open queries, I open forms and reports based on queries. I use VBA code to build filter for the form or report and pass the filter to form/report in WHERE CONDITION argument of DoCmd.OpenForm (or OpenReport). Example:

    DoCmd.OpenForm "formname", , , "TickNo='" & Me.OldTickNo & "'"
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Mike4172 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2012
    Posts
    17
    In Subform I'm search for records with same ticket number so I can crate a label. So I have a Text Box and when the ticketnumber matches one in the Table, it'll grab the data and print it to a label. The subform is on two seperate parent forms is the issue I'm running into.

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,921
    The label is a report printout? Use the VBA method to pass filter criteria to the label report.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    Mike4172 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2012
    Posts
    17
    Ok, please explain.

  6. #6
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,921
    Thread is already marked solved, did you resolve?

    Use VBA code in some event, perhaps button click, behind the form. Example code in my previous post.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  7. #7
    Mike4172 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2012
    Posts
    17
    Yes. I looked up how to do it from the command and it works good. Thanks for the pointer.

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

Similar Threads

  1. Replies: 7
    Last Post: 03-17-2013, 07:12 AM
  2. Access 2010 - Launch DB from 2 different paths
    By sunnie_joe in forum Programming
    Replies: 1
    Last Post: 04-19-2012, 06:11 AM
  3. multiple seach critera
    By dirtbiker1824 in forum Queries
    Replies: 1
    Last Post: 03-29-2011, 01:17 PM
  4. Query that would search multiple critera and delete
    By justinwright in forum Queries
    Replies: 2
    Last Post: 08-25-2010, 10:05 AM
  5. Setting paths different for each form
    By sailinxtc in forum Programming
    Replies: 9
    Last Post: 04-04-2010, 09:03 PM

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