Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

criteria for id field

Status
Not open for further replies.

matrixindicator

IS-IT--Management
Joined
Sep 6, 2007
Messages
418
Location
BE
Up to now I create two queries. They doing the same except that one is running "titles" and the other "medium" depending on the users choise in the form.
To avoid future trouble I like to get these two in one.

For this I need to say if in the combobox title is a value, take this value as criteria, set nothing as criteria, because it is an ID field, numeric, I can't use an empty string ""

Code:
[title ID]
crit : IIf([Forms]![frmTestView]![cbxTitles] Is Null;CInt("");[Forms]![frmTestView]![cbxTitles])

code of course is not working, how to, any ID ?
 
I think i can see what you're trying to do have you tried something like

strCriteria= "WHERE ID " & iif(nz([Forms]![frmTestView]![cbxTitles]),"")<>""," <>0","([Forms]![frmTestView]![cbxTitles])

Not really ssure where your "mediums", in first para of OP comes into the scenario?

Hope this helps, please clarify for more help mate :) JB

 
I'd try this:
Code:
[title ID]
crit : =[Forms]![frmTestView]![cbxTitles] OR [Forms]![frmTestView]![cbxTitles] Is Null

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top