Go Back   Access World Forums > Microsoft Access Discussion > Queries

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 09-18-2019, 04:08 AM   #1
Ksabai
Newly Registered User
 
Join Date: Jul 2017
Posts: 67
Thanks: 3
Thanked 0 Times in 0 Posts
Ksabai is on a distinguished road
Show All records in Access Query for null entry

Iam Using the SQL LIKE "*" & Forms!YourFormName.YourComboBoxName & "*" in the Criteria of a Access Query. i have 4 controls to be searched like this.

I need to search a field with Numbers. While Searching for "1" it returns 18,16,12,13 instead of just returning "1"

if i use =Forms!YourFormName.YourComboBoxName OR Forms!YourFormName.YourComboBoxName IS NULL

The Saved Query Gets Populated and when i open a report is shows ODBC Failed. Need help seriously here as project is based on searching thru number fields.

Ksabai is offline   Reply With Quote
Old 09-18-2019, 07:36 AM   #2
sxschech
Newly Registered User
 
Join Date: Mar 2010
Posts: 608
Thanks: 28
Thanked 111 Times in 100 Posts
sxschech is on a distinguished road
Re: Show All records in Access Query for null entry

If you are using like and wildcards, then you would expect to get numbers containing 1 per your example. If you need an exact match, do not use like and wildcards for that criteria.
sxschech is offline   Reply With Quote
Old 09-18-2019, 07:37 AM   #3
Ksabai
Newly Registered User
 
Join Date: Jul 2017
Posts: 67
Thanks: 3
Thanked 0 Times in 0 Posts
Ksabai is on a distinguished road
Re: Show All records in Access Query for null entry

Can u please then tell me what i shld do

Ksabai is offline   Reply With Quote
Old 09-18-2019, 07:42 AM   #4
theDBguy
Im here to help
 
theDBguy's Avatar
 
Join Date: Oct 2018
Location: SunnySandyEggo
Posts: 4,812
Thanks: 50
Thanked 1,098 Times in 1,079 Posts
theDBguy has a spectacular aura about theDBguy has a spectacular aura about
Re: Show All records in Access Query for null entry

Hi. What is your BE? Is it SQL Server? Are you querying a linked table or a view?
__________________
Just my 2 cents...

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
theDBguy is offline   Reply With Quote
Old 09-18-2019, 07:44 AM   #5
Ksabai
Newly Registered User
 
Join Date: Jul 2017
Posts: 67
Thanks: 3
Thanked 0 Times in 0 Posts
Ksabai is on a distinguished road
Re: Show All records in Access Query for null entry

its Sql Server, iam querying a linked table
Ksabai is offline   Reply With Quote
Old 09-18-2019, 07:58 AM   #6
arnelgp
error reading drive A:
 
arnelgp's Avatar
 
Join Date: May 2009
Location: somewhere out there
Posts: 8,488
Thanks: 68
Thanked 2,723 Times in 2,608 Posts
arnelgp is just really nice arnelgp is just really nice arnelgp is just really nice arnelgp is just really nice arnelgp is just really nice
Re: Show All records in Access Query for null entry

something like:

select * from linked_table where [field]=iif(trim(Forms!YourFormName.YourComboBoxName & "") = "", [field], Forms!YourFormName.YourComboBoxName)

__________________
"Never stop learning, because life never stops teaching"
arnelgp is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Show Null Records jland Queries 6 11-27-2012 01:18 PM
Query Criteria to Show Null Records if it meet the IIF Condition Mohsin Malik Queries 0 09-16-2012 10:41 PM
Show records as per data entry DeegZ Queries 2 06-08-2009 08:29 AM
ComboBox is null therefore all records show melanie Forms 9 07-03-2007 02:18 PM
Null Combo Box; Show All Records jsanders Queries 4 02-11-2006 02:12 PM




All times are GMT -8. The time now is 11:35 AM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Featured Forum post


Sponsored Links


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World