<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to get content of text edit box into &amp;quot;variable&amp;quot;? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-get-content-of-text-edit-box-into-quot-variable-quot/m-p/189506#M40797</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;thank you very much for your fast reply. Unfortunately I don't know much about programming and I'am still struggling - see below:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sorry - I did not understand, where to put the "IF-Command".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Open Database(
	"DBQ=X:\- ...HS.mdb;DefaultDir=X:\- ...;Driver={Driver do Microsoft Access (*.mdb)};DriverId=..;FIL=MS Access;FILEDSN=X:\...dsn;MaxBufferSize=2048;MaxScanRows=8;PageTimeout=5;SafeTransactions=0;Threads=3;UID=admin;UserCommitSync=Yes;",
	If( tbox_value != "",
		sql = Eval Insert(
			"SELECT TRBallShearHSBTTSF.Sample, Test, .... 
FROM TRBallShearHSBTTSF INNER JOIN SSBallShearHSBTTSF
ON TRBallShearHSBTTSF.Sample = SSBallShearHSBTTSF.Sample
WHERE User1 LIKE '%^tbox_value^%'",
			"HSS-Dage 4000"
		)
	)
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 26 Mar 2019 15:17:58 GMT</pubDate>
    <dc:creator>PS_Ato</dc:creator>
    <dc:date>2019-03-26T15:17:58Z</dc:date>
    <item>
      <title>How to get content of text edit box into "variable"?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-get-content-of-text-edit-box-into-quot-variable-quot/m-p/189477#M40793</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I'am looking for an alternative to manual change of variable ("&lt;STRONG&gt;Inspection Lot&lt;/STRONG&gt;") within the script itself.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;former sript:&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
Open Database(
"DBQ=X:...
WHERE User1 LIKE '%Inspection Lot%'", "HSS"
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I tried this - s.below, but it does not work. The script is running, but the "variable" was not used. Probably something is wrong with the format. Looking for advice.&lt;/P&gt;
&lt;P&gt;Thank you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;new script version:&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
win = New Window( "Edit Box - Enter the Inspection Lot",
&amp;lt;&amp;lt;Modal,
&amp;lt;&amp;lt;Return Result,
Text Box( "HSS Test: Enter the Inspection Lot" ),
texteditbox = TextEdit Box( "Inspection Lot" ),
Text Box( "Pressing OK - display of HSS graphs will be done automatically." ),
Button Box( "OK" ),
Button Box( "Cancel" )
);

Open Database(
"DBQ=X:...
WHERE User1 LIKE '%{"texteditbox"}%'", "HSS"
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Mar 2019 15:16:20 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-get-content-of-text-edit-box-into-quot-variable-quot/m-p/189477#M40793</guid>
      <dc:creator>PS_Ato</dc:creator>
      <dc:date>2019-03-26T15:16:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to get content of text edit box into "variable"?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-get-content-of-text-edit-box-into-quot-variable-quot/m-p/189504#M40795</link>
      <description>&lt;P&gt;You are calling the variable for your texteditbox "texteditbox", which is allowed but not good programming practice.&amp;nbsp; Here's how to use the value entered in the textedit box:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;
Names Default To Here( 1 );
tbox_value = "";
win = New Window( "Edit Box - Enter the Inspection Lot",
	&amp;lt;&amp;lt;Modal,
	&amp;lt;&amp;lt;Return Result,
	Text Box( "HSS Test: Enter the Inspection Lot" ),
	tbox = Text Edit Box( "Inspection Lot" ),
	Text Box( "Pressing OK - display of HSS graphs will be done automatically." ),
	hlistbox(
		Button Box( "OK",
			tbox_value = tbox &amp;lt;&amp;lt; get text()),
		Button Box( "Cancel" )
	)
);

if (tbox_value != "",
	sql = evalinsert(
"SELECT foo, bar
   FROM utopia
WHERE User1 LIKE '%{^tbox_value^}%'");

	show(sql);
	Open Database("DBQ=X:...", sql, "HSS");	
);
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If I enter ABC the log shows this:&lt;/P&gt;
&lt;PRE&gt;sql = "SELECT foo, bar
   FROM utopia
WHERE User1 LIKE '%{ABC}%'";&lt;/PRE&gt;</description>
      <pubDate>Tue, 26 Mar 2019 11:46:42 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-get-content-of-text-edit-box-into-quot-variable-quot/m-p/189504#M40795</guid>
      <dc:creator>pmroz</dc:creator>
      <dc:date>2019-03-26T11:46:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to get content of text edit box into "variable"?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-get-content-of-text-edit-box-into-quot-variable-quot/m-p/189506#M40797</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;thank you very much for your fast reply. Unfortunately I don't know much about programming and I'am still struggling - see below:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sorry - I did not understand, where to put the "IF-Command".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Open Database(
	"DBQ=X:\- ...HS.mdb;DefaultDir=X:\- ...;Driver={Driver do Microsoft Access (*.mdb)};DriverId=..;FIL=MS Access;FILEDSN=X:\...dsn;MaxBufferSize=2048;MaxScanRows=8;PageTimeout=5;SafeTransactions=0;Threads=3;UID=admin;UserCommitSync=Yes;",
	If( tbox_value != "",
		sql = Eval Insert(
			"SELECT TRBallShearHSBTTSF.Sample, Test, .... 
FROM TRBallShearHSBTTSF INNER JOIN SSBallShearHSBTTSF
ON TRBallShearHSBTTSF.Sample = SSBallShearHSBTTSF.Sample
WHERE User1 LIKE '%^tbox_value^%'",
			"HSS-Dage 4000"
		)
	)
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 26 Mar 2019 15:17:58 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-get-content-of-text-edit-box-into-quot-variable-quot/m-p/189506#M40797</guid>
      <dc:creator>PS_Ato</dc:creator>
      <dc:date>2019-03-26T15:17:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to get content of text edit box into "variable"?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-get-content-of-text-edit-box-into-quot-variable-quot/m-p/189516#M40799</link>
      <description>&lt;P&gt;A few suggestions for posting in this forum:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Indent your code (right-click &amp;gt; Reformat script)&lt;/LI&gt;
&lt;LI&gt;Paste the code into the forum using the &amp;lt;JSL&amp;gt; button.&amp;nbsp; That will retain syntax colors&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;On to your problem.&amp;nbsp; My code checks to see if a value was entered into the text box.&amp;nbsp; If there is a value there it creates a SQL string using the variable &lt;STRONG&gt;sql&lt;/STRONG&gt;, and then calls Open Database.&amp;nbsp; Your code calls open database with the IF command inside it.&amp;nbsp; That won't work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try this code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;	If( tbox_value != "",
		sql = Eval Insert(
			"SELECT TRBallShearHSBTTSF.Sample, Test, .... 
FROM TRBallShearHSBTTSF INNER JOIN SSBallShearHSBTTSF
ON TRBallShearHSBTTSF.Sample = SSBallShearHSBTTSF.Sample
WHERE User1 LIKE '%^tbox_value^%'");
		);

		dsn_string = "DBQ=X:\- ...HS.mdb;DefaultDir=X:\- ...;Driver={Driver do Microsoft Access (*.mdb)};DriverId=..;FIL=MS Access;FILEDSN=X:\...dsn;MaxBufferSize=2048;MaxScanRows=8;PageTimeout=5;SafeTransactions=0;Threads=3;UID=admin;UserCommitSync=Yes;";

		Open Database(dsn_string, sql, "HSS-Dage 4000");
);

&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 26 Mar 2019 13:17:52 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-get-content-of-text-edit-box-into-quot-variable-quot/m-p/189516#M40799</guid>
      <dc:creator>pmroz</dc:creator>
      <dc:date>2019-03-26T13:17:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to get content of text edit box into "variable"?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-get-content-of-text-edit-box-into-quot-variable-quot/m-p/189685#M40826</link>
      <description>&lt;P&gt;Many, many thanks - my first dialog box works - I'am so happy!!! :)&lt;/img&gt; :)&lt;/img&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Mar 2019 08:35:37 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-get-content-of-text-edit-box-into-quot-variable-quot/m-p/189685#M40826</guid>
      <dc:creator>PS_Ato</dc:creator>
      <dc:date>2019-03-27T08:35:37Z</dc:date>
    </item>
  </channel>
</rss>

