<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: Switch/Case statment in access</title>
	<atom:link href="http://itknowledgeexchange.techtarget.com/itanswers/switchcase-statment-in-access/feed/" rel="self" type="application/rss+xml" />
	<link>http://itknowledgeexchange.techtarget.com/itanswers/switchcase-statment-in-access/</link>
	<description></description>
	<pubDate>Fri, 27 Nov 2009 11:57:04 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.2</generator>
		<item>
		<title>By: Randym</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/switchcase-statment-in-access/#comment-55924</link>
		<dc:creator>Randym</dc:creator>
		<pubDate>Mon, 25 Aug 2008 17:53:09 +0000</pubDate>
		<guid isPermaLink="false">#comment-55924</guid>
		<description>You could do this based on what I said earlier except instead of using the Left and Mid functions, you need to make your own function.  This is kind of tough to explain in words but I'll give it a try.

You make a function whose parameters passed in are the code (i.e. translation code like "T C OD" or "T BID") and the spacing number that comes after the code.  For example:  GetTranslation("T C OD", 1) would return "T".  GetTranslation("T C OD", 2) would return "C" and GetTranslation("T C OD", 3) would return "OD".  
The function could use the Instr function that would find the position of the space based on the second parameter passed in.  And then find the position of the space that is one less than the second parameter passed in.  Then what is between those positions is the code you are looking for.  Of course, you need to make special considerations for the first and last codes.

Now with this method, you would only need one table with all the possible codes.  Then a query that would make as many codes columns  that you could have in one translation.  Lets say that you would only have at maximum 5 codes in one translation.  Your query would look like:

Select *, GetTranslation(TranslationCode, 1) As TransCode1, GetTranslation(TranslationCode, 2) As TransCode2, GetTranslation(TranslationCode, 3) As TransCode3, GetTranslation(TranslationCode, 4) As TransCode4, GetTranslation(TranslationCode, 5) As TransCode5 from Table

Now a second query to join the code table: 
In design view, bring in your first query and bring in the CodeTable 5 times.  Then left join each TransCode from the first query (1 through 5) to its respective CodeTable (CodeTable_1, CodeTable_2....)  This will allow you to get the description from the CodeTable.  (You would use outer joins beacuse some functions may not return anything that matches a code because there wasn't a code in that position)

The hardest part is to make the function.  But it can be done.</description>
		<content:encoded><![CDATA[<p>You could do this based on what I said earlier except instead of using the Left and Mid functions, you need to make your own function.  This is kind of tough to explain in words but I&#8217;ll give it a try.</p>
<p>You make a function whose parameters passed in are the code (i.e. translation code like &#8220;T C OD&#8221; or &#8220;T BID&#8221;) and the spacing number that comes after the code.  For example:  GetTranslation(&#8221;T C OD&#8221;, 1) would return &#8220;T&#8221;.  GetTranslation(&#8221;T C OD&#8221;, 2) would return &#8220;C&#8221; and GetTranslation(&#8221;T C OD&#8221;, 3) would return &#8220;OD&#8221;.<br />
The function could use the Instr function that would find the position of the space based on the second parameter passed in.  And then find the position of the space that is one less than the second parameter passed in.  Then what is between those positions is the code you are looking for.  Of course, you need to make special considerations for the first and last codes.</p>
<p>Now with this method, you would only need one table with all the possible codes.  Then a query that would make as many codes columns  that you could have in one translation.  Lets say that you would only have at maximum 5 codes in one translation.  Your query would look like:</p>
<p>Select *, GetTranslation(TranslationCode, 1) As TransCode1, GetTranslation(TranslationCode, 2) As TransCode2, GetTranslation(TranslationCode, 3) As TransCode3, GetTranslation(TranslationCode, 4) As TransCode4, GetTranslation(TranslationCode, 5) As TransCode5 from Table</p>
<p>Now a second query to join the code table:<br />
In design view, bring in your first query and bring in the CodeTable 5 times.  Then left join each TransCode from the first query (1 through 5) to its respective CodeTable (CodeTable_1, CodeTable_2&#8230;.)  This will allow you to get the description from the CodeTable.  (You would use outer joins beacuse some functions may not return anything that matches a code because there wasn&#8217;t a code in that position)</p>
<p>The hardest part is to make the function.  But it can be done.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Darkblue46</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/switchcase-statment-in-access/#comment-55901</link>
		<dc:creator>Darkblue46</dc:creator>
		<pubDate>Sun, 24 Aug 2008 08:34:22 +0000</pubDate>
		<guid isPermaLink="false">#comment-55901</guid>
		<description>thanks for your suggestion, but i believe as what you said its not working in my case, here i'll try to explain more.

in my database, i have created a shourtcut for some words Like:
T=take
Tab= tablet(s)
C=capsule(s)
D=day(s)
Dy=daily
OD=once daily
TSP=teaspoonful 
Bid=twice daily
Tid=three times daily
Qid=four times daily
Sw=shake will
Ins=insert

in the Form View; i have on field named Instruction, and in this field i need to type only the shortcut words Like:
T C OD
T BID

so, what i need is to view and save the Translation of that for each record.</description>
		<content:encoded><![CDATA[<p>thanks for your suggestion, but i believe as what you said its not working in my case, here i&#8217;ll try to explain more.</p>
<p>in my database, i have created a shourtcut for some words Like:<br />
T=take<br />
Tab= tablet(s)<br />
C=capsule(s)<br />
D=day(s)<br />
Dy=daily<br />
OD=once daily<br />
TSP=teaspoonful<br />
Bid=twice daily<br />
Tid=three times daily<br />
Qid=four times daily<br />
Sw=shake will<br />
Ins=insert</p>
<p>in the Form View; i have on field named Instruction, and in this field i need to type only the shortcut words Like:<br />
T C OD<br />
T BID</p>
<p>so, what i need is to view and save the Translation of that for each record.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
<!-- dynamic -->