using many queries at wrong criteria (1 Viewer)

samersy

New member
Local time
Today, 06:12
Joined
Jul 30, 2018
Messages
5
hello
I have many queries so how can I use query2 instead query1 when query1'criterias aren't achieved or aren't right.
thank
 

CJ_London

Super Moderator
Staff member
Local time
Today, 13:12
Joined
Feb 19, 2013
Messages
16,553
please clarify what you mean - provide examples
 

samersy

New member
Local time
Today, 06:12
Joined
Jul 30, 2018
Messages
5
please clarify what you mean - provide examples
I have update query(sum) with tow criteria name1=name2 and the second criteria is writer1= writer2 so in case name1<>name2 or writer1<>writer2 then the action doesn't show any message or warning that there is wrong for to use the second query.
is it clear my question?
 

CJ_London

Super Moderator
Staff member
Local time
Today, 13:12
Joined
Feb 19, 2013
Messages
16,553
better but still not clear. to help you we need to understand what you are trying to do. So show examples of each of the queries and the outcome you require
 

samersy

New member
Local time
Today, 06:12
Joined
Jul 30, 2018
Messages
5
please clarify what you mean - provide examples
I have update query(sum) with tow criteria name1=name2 and the second criteria is writer1= writer2 so in case name1<>name2 or writer1<>writer2 then the action doesn't show any message or warning that there is wrong for to use the second query.
is it clear my question?
 

samersy

New member
Local time
Today, 06:12
Joined
Jul 30, 2018
Messages
5
better but still not clear. to help you we need to understand what you are trying to do. So show examples of each of the queries and the outcome you require
I wrote the code in vba and use update query(sum) but when one criteria isn't achieved , I want a message tells the user that there is wrong in criteria or not achieved then I will use the second query , all these I have done in vba.
 

Mark_

Longboard on the internet
Local time
Today, 06:12
Joined
Sep 12, 2017
Messages
2,111
Can you please write out what you are trying to do without resorting to code? Your intent is important, then we can help identify what the code should be for your intent.
 

samersy

New member
Local time
Today, 06:12
Joined
Jul 30, 2018
Messages
5
Can you please write out what you are trying to do without resorting to code? Your intent is important, then we can help identify what the code should be for your intent.
as I have written previously , I have updatequery(sum)with tow criteria so I need a code that if one of its criteria is not right or empty to show message that "check the name or the writer" and so on and if we can show message then move to second query.
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 13:12
Joined
Jul 9, 2003
Messages
16,244
Hi samersy,

The problem is that although your explanation is very clear, it is also very specific.

There isn't enough information in your explanation for me to think "I know what's happening, this is how to solve the problem"

I need to see a bird's-eye view of what you are doing.

It is very likely that once it becomes clear what do you are doing, an invoicing application, a contact management database, a timesheet application, a stock control application, then an answer will be clear too.

In other words it is very likely that what you are trying to do has been done before, which means there's already a tried and tested solution but from the very concise explanation you are giving it's not clear which solution you require.

Sent from my SM-G925F using Tapatalk
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 09:12
Joined
Feb 19, 2002
Messages
42,970
I think that your problem is that the criteria is hard-coded in the queries and it needs to be variable. For example.

Where Somefield = "xyz"

Sometimes you are looking for "xyz" and sometimes you want "abc"

To solve this problem, you use a variable and typically a reference to a form field works best. Make a combo on a form and select "abc" or "xyz" and then use this as criteris:

Where SomeField = Forms!yourformname!cboYourComboname;
 

Users who are viewing this thread

Top Bottom