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!

User passing parameters will not show records

Status
Not open for further replies.

dragongunner0351

Programmer
Joined
Mar 16, 2006
Messages
104
Location
US
Hello all, I have a query that is not functioning as completly as I would like, I have a form that has two unbound combo boxes on it cboCompany & cboMachine, When the user selects the company name the query returns the appropriate data for that customer

Criteria = [Forms]![frmSearchData]![cboCompany]
NO PROBLEMS HERE!

However when the user selects a Machine from the combo control nothing happens. I tried using the same criteria as above except [Forms]![frmSearchData]![cboMachine]

I have put in code to allow for NULL but I'm not sure why this is not functioning. Any help will be appreciated.

Best Regards
 
Can you explain "nothing happens" and provide the SQL view of your query?

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Nothing Happens" defined as the query opens and there are no records

SQL View:
SELECT [Machine Leads Data].ID, [Machine Leads Data].Rating, [Machine Leads Data].[Machine P/N], [Machine Leads Data].[Machine Description], [Machine Leads Data].[Company Name], [Machine Leads Data].Company, [Machine Leads Data].State, [Machine Leads Data].[Contact Person], [Machine Leads Data].[Price Quoted], [Machine Leads Data].[Inquiry Date], [Machine Leads Data].[Last Contacted], [Machine Leads Data].Comments
FROM [Machine Leads Data] INNER JOIN Customers ON [Machine Leads Data].ID = Customers.ID
WHERE ((([Machine Leads Data].Company)=[Forms]![frmSearchData]![cboCompany])) OR ((([Machine Leads Data].Company)=[Forms]![frmSearchData]![cboCompany]) AND ((([Machine Leads Data].[Machine P/N]) Like [Forms]![frmSearchData]![cboMachine]) Is Null)) OR (((([Machine Leads Data].[Company]) Like [Forms]![frmSearchData]![cboCompany]) Is Null));
 
SELECT ...
FROM ...
WHERE ([Machine Leads Data].Company=[Forms]![frmSearchData]![cboCompany] OR [Forms]![frmSearchData]![cboCompany] Iss Null)
AND ([Machine Leads Data].[Machine P/N] Like [Forms]![frmSearchData]![cboMachine] OR [Forms]![frmSearchData]![cboCompany] Is Null)

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Thanks PH. I assume dragon... will find and remove the extra "s" in "Iss Null".

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
OOps, sorry for the typo :~/
 
You are excused since you have posted over 40,000 replies and earned over 7,000 stars in 5 years. A typo here and there is hardly noticed and certainly forgivable.

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Thank you both and yes the extra s was sticking out like a....you know. Oh yeah works great thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top