Go Back   Access World Forums > Microsoft Access Discussion > Queries

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 07-11-2019, 12:53 AM   #16
Emma35
Newly Registered User
 
Join Date: Sep 2012
Location: Ireland
Posts: 210
Thanks: 84
Thanked 0 Times in 0 Posts
Emma35 is on a distinguished road
Re: Query Criteria

It is populated with 8 different locations in short text format. Yes they do match.

Edit: I inherited this database second hand and it's a mess. I know the names don't coincide which is making things more complicated

Emma35 is offline   Reply With Quote
Old 07-11-2019, 02:10 AM   #17
CJ_London
Super Moderator
 
Join Date: Feb 2013
Location: UK
Posts: 10,910
Thanks: 40
Thanked 3,540 Times in 3,421 Posts
CJ_London is just really nice CJ_London is just really nice CJ_London is just really nice CJ_London is just really nice CJ_London is just really nice
Re: Query Criteria

and are your plant values also text?

and to be clear, since your cboBlock contains 20 values, and your table only 8, you are selecting one of the 8?
__________________
CJ_London
_______________________
A little thanks goes a long way. If you have found this post useful, please tick the thanks button
CJ_London is offline   Reply With Quote
Old 07-11-2019, 06:40 AM   #18
Emma35
Newly Registered User
 
Join Date: Sep 2012
Location: Ireland
Posts: 210
Thanks: 84
Thanked 0 Times in 0 Posts
Emma35 is on a distinguished road
Re: Query Criteria

Yes everything is set as text. Sorry i was a bit confused....cboBlock is looking at a table of possible blocks which i set up to populate the combo box. This was just for getting results from the query which looks at the main table

Emma35 is offline   Reply With Quote
Old 07-11-2019, 07:23 AM   #19
CJ_London
Super Moderator
 
Join Date: Feb 2013
Location: UK
Posts: 10,910
Thanks: 40
Thanked 3,540 Times in 3,421 Posts
CJ_London is just really nice CJ_London is just really nice CJ_London is just really nice CJ_London is just really nice CJ_London is just really nice
Re: Query Criteria

and the answer to my other question?

and to be clear, since your cboBlock contains 20 values, and your table only 8, you are selecting one of the 8?
__________________
CJ_London
_______________________
A little thanks goes a long way. If you have found this post useful, please tick the thanks button
CJ_London is offline   Reply With Quote
Old 07-11-2019, 11:21 PM   #20
Emma35
Newly Registered User
 
Join Date: Sep 2012
Location: Ireland
Posts: 210
Thanks: 84
Thanked 0 Times in 0 Posts
Emma35 is on a distinguished road
Re: Query Criteria

There is a table of values which i set up to populate the combo box cboBlock and this is used to feed the query which looks at the main table. Incidentally a block is a work area and a plant is a smaller section within that area.
Emma35 is offline   Reply With Quote
Old 07-12-2019, 12:00 AM   #21
CJ_London
Super Moderator
 
Join Date: Feb 2013
Location: UK
Posts: 10,910
Thanks: 40
Thanked 3,540 Times in 3,421 Posts
CJ_London is just really nice CJ_London is just really nice CJ_London is just really nice CJ_London is just really nice CJ_London is just really nice
Re: Query Criteria

Quote:
Incidentally a block is a work area and a plant is a smaller section within that area
which implies that in your form, you can only choose plants that are in the block.

I am at a loss to provide further guidance - suggest you upload a copy of your db - remove or disguise anything sensitive, then compact/repair and zip your db
__________________
CJ_London
_______________________
A little thanks goes a long way. If you have found this post useful, please tick the thanks button
CJ_London is offline   Reply With Quote
The Following User Says Thank You to CJ_London For This Useful Post:
Emma35 (07-12-2019)
Old 07-12-2019, 02:41 AM   #22
Emma35
Newly Registered User
 
Join Date: Sep 2012
Location: Ireland
Posts: 210
Thanks: 84
Thanked 0 Times in 0 Posts
Emma35 is on a distinguished road
Re: Query Criteria

Ok i'm uploading a version which has a lot of info removed so sorry if you get the odd error message. Apologies also if my explanations haven't been as clear as they could have been.
Thanks again for your time
Attached Files
File Type: zip Test - Copy.zip (250.1 KB, 14 views)

Emma35 is offline   Reply With Quote
Old 07-12-2019, 03:04 AM   #23
CJ_London
Super Moderator
 
Join Date: Feb 2013
Location: UK
Posts: 10,910
Thanks: 40
Thanked 3,540 Times in 3,421 Posts
CJ_London is just really nice CJ_London is just really nice CJ_London is just really nice CJ_London is just really nice CJ_London is just really nice
Re: Query Criteria

there is no data in your main table so nothing is returned, also, no report

however your cboBlock control is bound to column 2 and there is only 1 column so it should be bound to column 1

you have not set up any relationships - you said plant belongs to a block so your relationships should reflect that.
__________________
CJ_London
_______________________
A little thanks goes a long way. If you have found this post useful, please tick the thanks button
CJ_London is offline   Reply With Quote
Old 07-12-2019, 05:12 AM   #24
Emma35
Newly Registered User
 
Join Date: Sep 2012
Location: Ireland
Posts: 210
Thanks: 84
Thanked 0 Times in 0 Posts
Emma35 is on a distinguished road
Re: Query Criteria

I'm beginning to think i might as well start this thing again and build my own version rather than take a short cut and use the existing database....looks like it wasn't set up very well in the first place ?
Emma35 is offline   Reply With Quote
Old 07-12-2019, 06:03 AM   #25
CJ_London
Super Moderator
 
Join Date: Feb 2013
Location: UK
Posts: 10,910
Thanks: 40
Thanked 3,540 Times in 3,421 Posts
CJ_London is just really nice CJ_London is just really nice CJ_London is just really nice CJ_London is just really nice CJ_London is just really nice
Re: Query Criteria

if it is part of a bigger app, not enough to tell whether it is worth starting again

the lack of relationships may be the result of you copying tables across but not the relationships

did you fix the issue with the block combo and did it correct the problem?

__________________
CJ_London
_______________________
A little thanks goes a long way. If you have found this post useful, please tick the thanks button
CJ_London 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
[SOLVED] Query Criteria - overriding the results of one criteria (IIF statement?) mscraftyannie Queries 2 09-20-2017 08:21 AM
Query based on multiple criteria, show only results that match both criteria Scaniafan Queries 11 08-25-2017 05:08 AM
Ignoring null criteria in a multi-criteria query… Nano Queries 16 10-29-2013 12:01 PM
Setting query criteria to be 'blank' depending on the criteria of a combo box whitty15 Queries 5 10-22-2006 10:35 PM
[SOLVED] using multi-select on a listbox to set query criteria criteria kom73 Forms 1 10-10-2001 03:45 AM




All times are GMT -8. The time now is 09:20 PM.


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