Results 1 to 5 of 5
  1. #1
    Kyle02 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    16

    adding multiple searches in where condition

    Hey,
    I currently have this for my where condition, and searches the form based on the clientID selected in the combo box. ]

    The catch now is i have to add another search.



    ="[ClientID] =" & [TempVars]![ActiveControlValue]

    now i have to also search [ProductID]

    The combo Box is set up like this:

    ClientID....ContactName....ProductName....ProductI D
    Hidden.....Visible..............Visible........... ..Hidden

    how can i add [ProductID] into the existing where condition to add an additional parameter?
    thanks

  2. #2
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Do you know about the "Column" property of the combo box?

  3. #3
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows XP Access 2003
    Join Date
    Aug 2013
    Posts
    7,862
    Why do you have ProductID and client ID in the same combobox?

  4. #4
    Kyle02 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    16
    Yes, Where i know i am going wrong is the syntax.

    It is a macro, after update..
    ObjectType: Form
    ObjectName: frmAccount
    Record: First
    WhereCondition: (Originally: ="[ClientID] =" & [TempVars]![ActiveControlValue])

    Everything Works fine like that. Searchs on the clientID perfectly. Now I want to Add in another ProductID... So

    ="[ClientID] AND [ProductID] =" & [TempVars]![ActiveControlValue]

    You mention the column combo box property. But this isnt stating the cbobox it searches from, just the id...

    If it were to use the column idea, then cbogotoclient.Column(3) (ProductID) and cbogotoclient.Column(0) (ClientID) but that doesnt support what im doing. Or is my thinking wrong?

    ItsMe: Yes i do, In my Form (frmAccount) I need to search based on two criteria, ClientID, and there specified Product, Each Client Can have multiple Products, so i chose to set it up in one cbobox to speed up the process.

  5. #5
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    I don't know the logic behind your combo box, but you posted
    Code:
    The combo Box is set up like this:
    
    ClientID....ContactName....ProductName....ProductID
    Hidden......Visible............Visible.............Hidden
    so, if the combo box name is "cbogotoclient", I would try:
    Code:
    ="[ClientID] =" & Me.cbogotoclient & " AND [ProductID] = " & Me.cbogotoclient.Column(3)

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

Similar Threads

  1. Replies: 6
    Last Post: 07-29-2013, 05:05 AM
  2. Replies: 4
    Last Post: 08-06-2012, 10:25 AM
  3. DLookup with multiple field condition
    By agent- in forum Programming
    Replies: 4
    Last Post: 10-15-2011, 05:17 PM
  4. Printing multiple reports at once based on condition
    By justinwright in forum Reports
    Replies: 24
    Last Post: 04-13-2011, 01:40 PM
  5. Replies: 1
    Last Post: 11-04-2010, 12:57 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