No Data multiple record sources

burrina

Registered User.
Local time
Today, 16:24
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
 
Well, you've mixed And & Or without clarifying the logic with parentheses, and you failed to repeat the field name in the Or.
 
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:
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

Back
Top Bottom