I am having a bit of a problem following your logic (maybe the problem, is the logic?)
You query a database table and return all/ a selection records
You then repeat through the recordset
with an IF you find a record where county view ID = 0
You then query a table and return a list of counties
but as this is in a repeat, if more than one record has country view = 0 this is repeated, effectively until the loop ends
What are you trying to output and what do you expect returned? Do you really want the second query to be executed multiple times if multiple records return intCountryView == 0
I have an employee table which has an intCountryView column flag.
0 = see all counties.
1 = Ireland only
2 = UK only
There is a county table which lists all the counties by county ID, county name and a intCountryView column.
So, the first thing I do is get the intCountryView from the logged in employee.
In my case, I can see all counties, so my intCountryView ID = 0
Now (***I could be doing this all completely wrong!***), I run a Repeat so that I can use the returned value from the employees table i.e. 0.
Now that I have access to the returned value via the repeat, I preform a “IF” statement.
If the statement is true, I return all values from the county table. This would have been used to populate the Custom Select.
The next step after would be to preform another “IF” statement. So of the returned value = 1 (Ireland only), then I would have preformed a query to return all the counties linked to Ireland.
If this helps clear it up, great, if not, I am clearly wasting everyone’s time with my BullSh*t logic of how I expected it to work. Hehe
This sort of thing is never a waste of time, it has a learning outcome for everyone, that’s what this forum is all about
Is this to be displayed in a single form type layout, multi form or table?
@Hyperbytes HI, unfortunately the existing customers database is set to using the three deeply in their existing CRM, so, I have been forced to work with them.
@Hyperbytes OK, let me have a go at that! But I didn’t know you could set a condition on the query like that, and that will come in very handy going forward! So for that alone “I thank you”.
I will get back to you on the suggested steps shortly.