Go Back   Access World Forums > Microsoft Access Discussion > Forms

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 11-29-2019, 07:17 PM   #1
JCColindres
Newly Registered User
 
Join Date: Nov 2019
Posts: 12
Thanks: 7
Thanked 1 Time in 1 Post
JCColindres is on a distinguished road
Combobox "All" option code

Hi guys,

I have a question with comboboxes I have "combo7" with 3 option A B and C, I added an "All" option with UNION SELECT "<All>"

But now I'm stuck on how to process that "all" selection,
I got this so far

Private Sub YourCombobox_AfterUpdate()
If Me.Combo7= "<All>" Then


and Im stuck on the code to run the report with no criteria


Thanks

JCColindres is offline   Reply With Quote
Old 11-29-2019, 07:29 PM   #2
theDBguy
I知 here to help
 
theDBguy's Avatar
 
Join Date: Oct 2018
Location: SunnySandyEggo
Posts: 6,486
Thanks: 58
Thanked 1,419 Times in 1,400 Posts
theDBguy has a spectacular aura about theDBguy has a spectacular aura about
Re: Conditionally present a Drop down list

Quote:
Originally Posted by JCColindres View Post
Hi guys,

I have a question with comboboxes I have "combo7" with 3 option A B and C, I added an "All" option with UNION SELECT "<All>"

But now I'm stuck on how to process that "all" selection,
I got this so far

Private Sub YourCombobox_AfterUpdate()
If Me.Combo7= "<All>" Then


and Im stuck on the code to run the report with no criteria


Thanks
How were you running the report before adding the all option?
__________________
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 online now   Reply With Quote
Old 11-29-2019, 07:33 PM   #3
JCColindres
Newly Registered User
 
Join Date: Nov 2019
Posts: 12
Thanks: 7
Thanked 1 Time in 1 Post
JCColindres is on a distinguished road
Re: Conditionally present a Drop down list

By selecting one letter at the time

JCColindres is offline   Reply With Quote
Old 11-29-2019, 07:37 PM   #4
theDBguy
I知 here to help
 
theDBguy's Avatar
 
Join Date: Oct 2018
Location: SunnySandyEggo
Posts: 6,486
Thanks: 58
Thanked 1,419 Times in 1,400 Posts
theDBguy has a spectacular aura about theDBguy has a spectacular aura about
Re: Conditionally present a Drop down list

Quote:
Originally Posted by JCColindres View Post
By selecting one letter at the time
No, I mean how exactly do you open the report. Or, how does selecting one letter works? Are you using any code? If so, can you show it to us?

PS. You might consider starting your own thread.
__________________
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 online now   Reply With Quote
Old 11-29-2019, 07:40 PM   #5
JCColindres
Newly Registered User
 
Join Date: Nov 2019
Posts: 12
Thanks: 7
Thanked 1 Time in 1 Post
JCColindres is on a distinguished road
Re: Conditionally present a Drop down list

dates
Between [Forms]![Cases Report]![From] And [Forms]![Cases Report]![to]

Severity
[Forms]![Cases Report]![Combo7]

manager [Forms]![Cases Report]![Combo9]

Is this it?

Sorry I'm new at this
JCColindres is offline   Reply With Quote
Old 11-29-2019, 07:46 PM   #6
JCColindres
Newly Registered User
 
Join Date: Nov 2019
Posts: 12
Thanks: 7
Thanked 1 Time in 1 Post
JCColindres is on a distinguished road
Re: Conditionally present a Drop down list

Ill scramble the names and upload it on Monday, it wll be a lot easier since I lack the vocabulary.

Thanks a lot and enjoy your weekend.
JCColindres is offline   Reply With Quote
Old 11-29-2019, 07:52 PM   #7
theDBguy
I知 here to help
 
theDBguy's Avatar
 
Join Date: Oct 2018
Location: SunnySandyEggo
Posts: 6,486
Thanks: 58
Thanked 1,419 Times in 1,400 Posts
theDBguy has a spectacular aura about theDBguy has a spectacular aura about
Re: Conditionally present a Drop down list

Quote:
Originally Posted by JCColindres View Post
dates
Between [Forms]![Cases Report]![From] And [Forms]![Cases Report]![to]

Severity
[Forms]![Cases Report]![Combo7]

manager [Forms]![Cases Report]![Combo9]

Is this it?

Sorry I'm new at this
Okay, assuming you were referring to Severity when said you wanted to select All, then try changing your criteria to something like.
Code:
(Forms![Cases Report].Combo7 Or Forms![Cases Report].Combo7 = "all")

__________________
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 online now   Reply With Quote
The Following User Says Thank You to theDBguy For This Useful Post:
JCColindres (12-02-2019)
Old 11-30-2019, 04:27 AM   #8
isladogs
High Noon Moderator
 
isladogs's Avatar
 
Join Date: Jan 2017
Location: Somerset, UK
Posts: 11,252
Thanks: 115
Thanked 3,075 Times in 2,793 Posts
isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold
Re: Combobox "All" option code

JCColindres
I moved these posts to a new thread as you had hijacked another thread question.
__________________
If this answer has helped, please click the Thanks button and/or click the 'reputation scales' symbol on the left.

Colin (Mendip Data Systems)
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.


Website links:
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.
,
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.


Common sense and a sense of humour are the same thing, moving at different speeds. (Clive James - RIP)
isladogs is offline   Reply With Quote
The Following User Says Thank You to isladogs For This Useful Post:
dcavaiani (11-30-2019)
Old 12-02-2019, 02:23 PM   #9
JCColindres
Newly Registered User
 
Join Date: Nov 2019
Posts: 12
Thanks: 7
Thanked 1 Time in 1 Post
JCColindres is on a distinguished road
Re: Conditionally present a Drop down list

Quote:
Originally Posted by theDBguy View Post
Okay, assuming you were referring to Severity when said you wanted to select All, then try changing your criteria to something like.
Code:
(Forms![Cases Report].Combo7 Or Forms![Cases Report].Combo7 = "all")
Thank you that did it, but it now I have another question sorry,

I added the same code to the managers combobox also and It works only when I select "all" on both comboxes

If I want to do a search for All severity for a single manager I'm getting a blank query, same if I want to run an all severities for a single manager,

Is there a way to make that work?

Here is the code I found where is it hehe

SELECT Cases.[SR Number], Cases.[Asigned Date], Cases.Agent, Cases.Type, Cases.Severity, Cases.Topic, Cases.Manager, Cases.S3
FROM Cases
WHERE (((Cases.[Asigned Date]) Between Forms![Cases Report]!From And Forms![Cases Report]!to) And ((Cases.Severity)=Forms![Cases Report]!Combo7) And ((Cases.Manager)=Forms![Cases Report]!Combo9)) Or ((Forms![Cases Report].Combo7="<All>") And (Forms![Cases Report].Combo9="<All>"));
JCColindres is offline   Reply With Quote
Old 12-02-2019, 02:41 PM   #10
theDBguy
I知 here to help
 
theDBguy's Avatar
 
Join Date: Oct 2018
Location: SunnySandyEggo
Posts: 6,486
Thanks: 58
Thanked 1,419 Times in 1,400 Posts
theDBguy has a spectacular aura about theDBguy has a spectacular aura about
Re: Conditionally present a Drop down list

Quote:
Originally Posted by JCColindres View Post
Thank you that did it, but it now I have another question sorry,

I added the same code to the managers combobox also and It works only when I select "all" on both comboxes

If I want to do a search for All severity for a single manager I'm getting a blank query, same if I want to run an all severities for a single manager,

Is there a way to make that work?

Here is the code I found where is it hehe

SELECT Cases.[SR Number], Cases.[Asigned Date], Cases.Agent, Cases.Type, Cases.Severity, Cases.Topic, Cases.Manager, Cases.S3
FROM Cases
WHERE (((Cases.[Asigned Date]) Between Forms![Cases Report]!From And Forms![Cases Report]!to) And ((Cases.Severity)=Forms![Cases Report]!Combo7) And ((Cases.Manager)=Forms![Cases Report]!Combo9)) Or ((Forms![Cases Report].Combo7="<All>") And (Forms![Cases Report].Combo9="<All>"));
Hi. I would suggest you carefully study your parentheses placements because they mean "priority" when it comes to logic. Since you have a mixture of And and Or operators, the parens will dictate how the criteria is applied to the data set.
__________________
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 online now   Reply With Quote
The Following User Says Thank You to theDBguy For This Useful Post:
JCColindres (12-02-2019)
Old 12-02-2019, 04:25 PM   #11
JCColindres
Newly Registered User
 
Join Date: Nov 2019
Posts: 12
Thanks: 7
Thanked 1 Time in 1 Post
JCColindres is on a distinguished road
Re: Conditionally present a Drop down list

Quote:
Originally Posted by theDBguy View Post
Hi. I would suggest you carefully study your parentheses placements because they mean "priority" when it comes to logic. Since you have a mixture of And and Or operators, the parens will dictate how the criteria is applied to the data set.
Hi,

I got it working, just added teh other 2 selection posibilities:

(((Cases.[Asigned Date]) Between [Forms]![Cases Report]![From] And [Forms]![Cases Report]![to])
AND
((Cases.Severity)=[Forms]![Cases Report]![Combo7])
AND
((Cases.Manager)=[Forms]![Cases Report]![Combo9]))
OR
((([Forms]![Cases Report].[Combo7])="<All>")
AND
(([Forms]![Cases Report].[Combo9])="<All>"))
OR
(((Cases.Manager)=[Forms]![Cases Report]![Combo9]) AND
(([Forms]![Cases Report].[Combo7])="<All>"))
OR
(((Cases.Severity)=[Forms]![Cases Report]![Combo7])
AND
(([Forms]![Cases Report].[Combo9])="<All>"));


Thanks a lot for your help
JCColindres is offline   Reply With Quote
Old 12-02-2019, 05:30 PM   #12
theDBguy
I知 here to help
 
theDBguy's Avatar
 
Join Date: Oct 2018
Location: SunnySandyEggo
Posts: 6,486
Thanks: 58
Thanked 1,419 Times in 1,400 Posts
theDBguy has a spectacular aura about theDBguy has a spectacular aura about
Re: Conditionally present a Drop down list

Quote:
Originally Posted by JCColindres View Post
Hi,

I got it working, just added teh other 2 selection posibilities:

(((Cases.[Asigned Date]) Between [Forms]![Cases Report]![From] And [Forms]![Cases Report]![to])
AND
((Cases.Severity)=[Forms]![Cases Report]![Combo7])
AND
((Cases.Manager)=[Forms]![Cases Report]![Combo9]))
OR
((([Forms]![Cases Report].[Combo7])="<All>")
AND
(([Forms]![Cases Report].[Combo9])="<All>"))
OR
(((Cases.Manager)=[Forms]![Cases Report]![Combo9]) AND
(([Forms]![Cases Report].[Combo7])="<All>"))
OR
(((Cases.Severity)=[Forms]![Cases Report]![Combo7])
AND
(([Forms]![Cases Report].[Combo9])="<All>"));


Thanks a lot for your help
Hi. Glad to hear you got it to work. Good job!

__________________
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 online now   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
Need "Select All Option" in Combobox for Query Parameters jimbo92 General 21 10-27-2019 02:27 AM
How to have a "All" or "No selection means all" option on my Listbox Filter? BobbyN Modules & VBA 4 02-28-2017 03:53 PM
Combobox For "This Week" or "This Month" etc to populate 2 text boxes for filter OR. MackMan Modules & VBA 3 02-06-2015 05:11 AM
Changing How Combobox Functions Based on Form's Editing Mode? ("Add" vs. "Edit") pitt_ph Forms 6 09-25-2012 08:07 PM
possible to add a "select none" option to a combobox drop menu?? killyridols Forms 1 08-05-2009 10:39 AM




All times are GMT -8. The time now is 05:33 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