<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[My Visual Database — combobox.sqlvalue with multiple values without sql query?]]></title>
		<link>https://myvisualdatabase.com/forum/viewtopic.php?id=8553</link>
		<atom:link href="https://myvisualdatabase.com/forum/extern.php?action=feed&amp;tid=8553&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in combobox.sqlvalue with multiple values without sql query?.]]></description>
		<lastBuildDate>Wed, 07 Jun 2023 22:28:38 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: combobox.sqlvalue with multiple values without sql query?]]></title>
			<link>https://myvisualdatabase.com/forum/viewtopic.php?pid=47893#p47893</link>
			<description><![CDATA[<p>Looks like a brilliant idea, I love configuration tables, I already use one. It does not apply to this very case but could prove useful.</p><p>Thanks Derek!!</p>]]></description>
			<author><![CDATA[null@example.com (tcoton)]]></author>
			<pubDate>Wed, 07 Jun 2023 22:28:38 +0000</pubDate>
			<guid>https://myvisualdatabase.com/forum/viewtopic.php?pid=47893#p47893</guid>
		</item>
		<item>
			<title><![CDATA[Re: combobox.sqlvalue with multiple values without sql query?]]></title>
			<link>https://myvisualdatabase.com/forum/viewtopic.php?pid=47892#p47892</link>
			<description><![CDATA[<p>Hi TCoton, Hi Sparrow,<br />Another option could be to take a more &#039;data driven&#039; approach and use some sort of &#039;configuration&#039; table to determine what gets shown / hidden, what color is selected for a panel, what text is shown etc etc depending on the value that is selected from a combobox.&nbsp; <br />It&#039;s not always suitable (depending on the type of project you are working on) but does mean that nothing is hard-coded and so can offer flexibility.<br />Maybe it can give you some ideas.<br />Derek.</p>]]></description>
			<author><![CDATA[null@example.com (derek)]]></author>
			<pubDate>Wed, 07 Jun 2023 20:41:12 +0000</pubDate>
			<guid>https://myvisualdatabase.com/forum/viewtopic.php?pid=47892#p47892</guid>
		</item>
		<item>
			<title><![CDATA[Re: combobox.sqlvalue with multiple values without sql query?]]></title>
			<link>https://myvisualdatabase.com/forum/viewtopic.php?pid=47889#p47889</link>
			<description><![CDATA[<p>Thanks Sparrow for the geek version of it, it does the same but it takes longer to write than the version from Derek <img src="https://myvisualdatabase.com/forum/img/smilies/wink.png" width="15" height="15" alt="wink" /></p>]]></description>
			<author><![CDATA[null@example.com (tcoton)]]></author>
			<pubDate>Wed, 07 Jun 2023 17:52:56 +0000</pubDate>
			<guid>https://myvisualdatabase.com/forum/viewtopic.php?pid=47889#p47889</guid>
		</item>
		<item>
			<title><![CDATA[Re: combobox.sqlvalue with multiple values without sql query?]]></title>
			<link>https://myvisualdatabase.com/forum/viewtopic.php?pid=47888#p47888</link>
			<description><![CDATA[<div class="codebox"><pre><code>procedure Form1_ComboBox1_OnChange (Sender: TObject);
var
arr: array[0..2] of string = [&#039;1&#039;,&#039;3&#039;,&#039;5&#039;];
i: integer;
begin
  for i := 0 to length(arr) - 1 do
    if form1.ComboBox1.sqlValue = arr[i] then
    begin
    form1.panel1.color := clpurple;
    break;
    end else form1.panel1.color := clBtnFace;
end;</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (sparrow)]]></author>
			<pubDate>Wed, 07 Jun 2023 16:57:35 +0000</pubDate>
			<guid>https://myvisualdatabase.com/forum/viewtopic.php?pid=47888#p47888</guid>
		</item>
		<item>
			<title><![CDATA[Re: combobox.sqlvalue with multiple values without sql query?]]></title>
			<link>https://myvisualdatabase.com/forum/viewtopic.php?pid=47887#p47887</link>
			<description><![CDATA[<p>That&#039;s it, thanks Derek.</p><p>So, the object.SqlValue property can only accept a unique value but it is good to see that we can place a &quot;or&quot; in between them one way or another! <img src="https://myvisualdatabase.com/forum/img/smilies/smile.png" width="15" height="15" alt="smile" /></p><br /><div class="codebox"><pre><code>if (form1.combobox1.sqlvalue = &#039;4&#039;) or (form1.combobox1.sqlvalue = &#039;5&#039;) then form1.panel1.color := clpurple;</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (tcoton)]]></author>
			<pubDate>Wed, 07 Jun 2023 16:21:06 +0000</pubDate>
			<guid>https://myvisualdatabase.com/forum/viewtopic.php?pid=47887#p47887</guid>
		</item>
		<item>
			<title><![CDATA[Re: combobox.sqlvalue with multiple values without sql query?]]></title>
			<link>https://myvisualdatabase.com/forum/viewtopic.php?pid=47885#p47885</link>
			<description><![CDATA[<p>Hi,<br />So, something like this?<br />Derek.</p>]]></description>
			<author><![CDATA[null@example.com (derek)]]></author>
			<pubDate>Wed, 07 Jun 2023 15:58:48 +0000</pubDate>
			<guid>https://myvisualdatabase.com/forum/viewtopic.php?pid=47885#p47885</guid>
		</item>
		<item>
			<title><![CDATA[Re: combobox.sqlvalue with multiple values without sql query?]]></title>
			<link>https://myvisualdatabase.com/forum/viewtopic.php?pid=47878#p47878</link>
			<description><![CDATA[<p>I may express myself wrongly, let me reformulate.</p><p>I have a table with ids that are associated to a status.<br />This status is displayed via a combobox.<br />According to the status displayed or chosen, a script changes something in the project, like disabling an object or checking automatically a checkbox.<br />Some other status could lead to the same action.<br />Instead of writing complex SQL queries that I can write, I want to know if I can associate multiple values to the object property &quot;SqlValue&quot; in the script tab like in the attached example.</p><p>In this project, selecting a color changes the panel below it. The last 2 choices should both change to purple, not red but it does not with current script.</p><div class="codebox"><pre><code>procedure Form1_ComboBox1_OnChange (Sender: TObject);
begin
if form1.ComboBox1.sqlValue=&#039;2&#039; then
form1.Panel1.Color:= clGreen;
if form1.ComboBox1.sqlValue=&#039;3&#039; then
form1.Panel1.Color:= clTeal;

// I would like to combine both sqlvalue = so it would be like a sqlExecute(select status.id from status where id=4 or id=5) .... or where id in(&#039;4&#039;,&#039;5&#039;)

{if form1.ComboBox1.sqlValue=&#039;4&#039; then    // same color as below
form1.Panel1.Color:= clRed;
if form1.ComboBox1.sqlValue=&#039;5&#039; then    // same color as above
form1.Panel1.Color:= clRed; }

if form1.ComboBox1.sqlValue=&#039;4 or 5&#039; then    // either choice = same color
form1.Panel1.Color:= clPurple;
end;</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (tcoton)]]></author>
			<pubDate>Wed, 07 Jun 2023 13:48:23 +0000</pubDate>
			<guid>https://myvisualdatabase.com/forum/viewtopic.php?pid=47878#p47878</guid>
		</item>
		<item>
			<title><![CDATA[Re: combobox.sqlvalue with multiple values without sql query?]]></title>
			<link>https://myvisualdatabase.com/forum/viewtopic.php?pid=47861#p47861</link>
			<description><![CDATA[<p>Hi,<br />Would using the combobox &#039;multi-select&#039; option give you what you want?<br />Derek.</p>]]></description>
			<author><![CDATA[null@example.com (derek)]]></author>
			<pubDate>Tue, 06 Jun 2023 23:24:08 +0000</pubDate>
			<guid>https://myvisualdatabase.com/forum/viewtopic.php?pid=47861#p47861</guid>
		</item>
		<item>
			<title><![CDATA[Re: combobox.sqlvalue with multiple values without sql query?]]></title>
			<link>https://myvisualdatabase.com/forum/viewtopic.php?pid=47860#p47860</link>
			<description><![CDATA[<p>That is not exactly what I am looking for, this is data aggregation within a combobox.<br />I am writing a script to check if a combobox sqlvalue is either X or Y to change its display according to what is found. I know I can write a sql query to get the &quot;sqlvalue in the range I want but I was wondering if the &quot;SqlValue&quot; property could retrieve multiple values or if it is always a unique value.</p>]]></description>
			<author><![CDATA[null@example.com (tcoton)]]></author>
			<pubDate>Tue, 06 Jun 2023 22:09:00 +0000</pubDate>
			<guid>https://myvisualdatabase.com/forum/viewtopic.php?pid=47860#p47860</guid>
		</item>
		<item>
			<title><![CDATA[Re: combobox.sqlvalue with multiple values without sql query?]]></title>
			<link>https://myvisualdatabase.com/forum/viewtopic.php?pid=47859#p47859</link>
			<description><![CDATA[<p><span class="postimg"><img src="http://myvisualdatabase.com/forum/misc.php?action=pun_attachment&amp;item=9551&amp;download=0" alt="http://myvisualdatabase.com/forum/misc.php?action=pun_attachment&amp;amp;item=9551&amp;amp;download=0" /></span>...</p>]]></description>
			<author><![CDATA[null@example.com (pavlenko.vladimir.v)]]></author>
			<pubDate>Tue, 06 Jun 2023 21:47:49 +0000</pubDate>
			<guid>https://myvisualdatabase.com/forum/viewtopic.php?pid=47859#p47859</guid>
		</item>
		<item>
			<title><![CDATA[combobox.sqlvalue with multiple values without sql query?]]></title>
			<link>https://myvisualdatabase.com/forum/viewtopic.php?pid=47858#p47858</link>
			<description><![CDATA[<p>Does anyone knows if it is possible to retrieve multiple values for the property &quot;SqlValue&quot; of a combobox like so or do I have to write an SQL query?</p><p>Possible or not?&nbsp; I already know this syntax does not work but I cannot find any documentation about this property:<br /></p><div class="codebox"><pre><code>if Form.Statuslist.sqlValue in (&#039;2&#039;, &#039;13&#039;) then .... do something</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (tcoton)]]></author>
			<pubDate>Tue, 06 Jun 2023 21:08:06 +0000</pubDate>
			<guid>https://myvisualdatabase.com/forum/viewtopic.php?pid=47858#p47858</guid>
		</item>
	</channel>
</rss>
