No Data multiple record sources (1 Viewer)

burrina

Registered User.
Local time
Today, 08:31
Joined
May 10, 2014
Messages
972
I have a form that uses several record sources depending on a selection. So there could be records for one type of criteria when there are none for the other.

Record source runs from main form.
If no data code runs from form being opened.

I tried this with no success!
PHP:
[/QUOTE]

If RecordsetClone.RecordCount <= 0 And ([EmpOrConText]) = "Employee Check" Or "Contractor Check" Then
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 06:31
Joined
Aug 30, 2003
Messages
36,127
Well, you've mixed And & Or without clarifying the logic with parentheses, and you failed to repeat the field name in the Or.
 

burrina

Registered User.
Local time
Today, 08:31
Joined
May 10, 2014
Messages
972
Form opens with almost the same record source (same tables) but just different criteria is the difference.
PHP:
If RecordsetClone.RecordCount <= 0 And ([EmpOrConText]) = "Employee Checks" Or ([EmpOrConText]) = "Per Job Contractor Checks" Then
DoCmd.OpenForm "frmMessage"


So, what is it you think I am missing?
Guess as usual I didn't explain well enough.
Same query structure record source with only different criteria is all.
Same query renamed with different criteria!
 
Last edited:

pbaldy

Wino Moderator
Staff member
Local time
Today, 06:31
Joined
Aug 30, 2003
Messages
36,127
Again,

(1 And 2) Or 3

Is not the same as

1 And (2 Or 3)

You should clarify your desired logic.
 

Users who are viewing this thread

Top Bottom