<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Bacon Bits: &#187; Access</title>
	<atom:link href="http://datapigtechnologies.com/blog/index.php/tag/access/feed/" rel="self" type="application/rss+xml" />
	<link>http://datapigtechnologies.com/blog</link>
	<description>A DataPig Technologies Blog</description>
	<lastBuildDate>Tue, 07 Feb 2012 16:56:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.4</generator>
		<item>
		<title>Formatting Access Queries to the Thousands Place</title>
		<link>http://datapigtechnologies.com/blog/index.php/formatting-access-queries-to-the-thousands-place/</link>
		<comments>http://datapigtechnologies.com/blog/index.php/formatting-access-queries-to-the-thousands-place/#comments</comments>
		<pubDate>Mon, 24 Oct 2011 12:03:30 +0000</pubDate>
		<dc:creator>datapig</dc:creator>
				<category><![CDATA[Access Queries]]></category>
		<category><![CDATA[Access Tips and Tricks]]></category>
		<category><![CDATA[Access]]></category>
		<category><![CDATA[Queries]]></category>
		<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[Visualization]]></category>

		<guid isPermaLink="false">http://datapigtechnologies.com/blog/index.php/formatting-access-queries-to-the-thousands-place/</guid>
		<description><![CDATA[In an Email last week, Christina asks: &#8220;Do you know of an easy way to show Access query results in thousands? Thanks DataPig.You are the like that black bird on Angry Birds – the bomb.&#8221; Ok….so I added that last sentence. But Christina did ask a pretty good question. . Here&#8217;s how you can format [...]
Related posts:<ol>
<li><a href='http://datapigtechnologies.com/blog/index.php/documenting-access-queries-in-excel/' rel='bookmark' title='Documenting Access Queries in Excel'>Documenting Access Queries in Excel</a></li>
<li><a href='http://datapigtechnologies.com/blog/index.php/changing-the-sort-order-of-crosstab-column-headings/' rel='bookmark' title='Changing Sort Order of Access Crosstab Headings'>Changing Sort Order of Access Crosstab Headings</a></li>
<li><a href='http://datapigtechnologies.com/blog/index.php/getting-to-workdays-in-access/' rel='bookmark' title='Getting to Workdays in Access'>Getting to Workdays in Access</a></li>
<li><a href='http://datapigtechnologies.com/blog/index.php/replacing-the-microsoft-access-splash-screen/' rel='bookmark' title='Replacing the Microsoft Access Splash Screen'>Replacing the Microsoft Access Splash Screen</a></li>
<li><a href='http://datapigtechnologies.com/blog/index.php/create-a-keyboard-hot-key-to-start-excel-or-access/' rel='bookmark' title='Create a Keyboard Hot Key to Start Excel or Access'>Create a Keyboard Hot Key to Start Excel or Access</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>In an Email last week, Christina asks:
</p>
<p><em>&#8220;Do you know of an easy way to show Access query results in thousands?<br />
Thanks DataPig.You are the like that black bird on Angry Birds – the bomb.&#8221;<br />
</em></p>
<p>Ok….so I added that last sentence.  But Christina did ask a pretty good question.
</p>
<p><span style="color:white">.<br />
</span></p>
<p>Here&#8217;s how you can format Access query fields so that they show as thousands.
</p>
<p><span style="color:white">.<br />
</span></p>
<p>You first start with a working query.  As you can see, this query shows revenue by market with an indication of how much of that revenue comes from Internet Sales.  You&#8217;ll notice that the revenue columns inundate you with lots of numbers.  That is to say, the revenue columns are difficult to read.   Showing these columns in thousands would help readability.<br />
<span id="more-3506"></span>
</p>
<p><img src="http://datapigtechnologies.com/blog/wp-content/uploads/2011/10/102411_1203_FormattingA1.png" alt=""/>
	</p>
<p><span style="color:white">.<br />
</span></p>
<p><span style="color:white">.<br />
</span></p>
<p>Go into Design View and right click on the query field you want to format.
</p>
<p>This will pull up a context menu where you can select Properties.
</p>
<p><img src="http://datapigtechnologies.com/blog/wp-content/uploads/2011/10/102411_1203_FormattingA2.png" alt=""/>
	</p>
<p><span style="color:white">.<br />
</span></p>
<p><span style="color:white">.<br />
</span></p>
<p>In the Property Sheet dialog box, you will see the Format property.
</p>
<p>Here, you can enter any format syntax you would like.  In this case, we want to enter a format string that will give us numbers in the thousands place.  So we enter <strong>$#,###,</strong>.<strong><br/><img src="http://datapigtechnologies.com/blog/wp-content/uploads/2011/10/102411_1203_FormattingA3.png" alt=""/><br />
		</strong></p>
<p><span style="color:white">.<br />
</span></p>
<p><span style="color:white">.<br />
</span></p>
<p>Once we save and run the query again, we can see that the numbers are in thousands place – making them much easier to read.
</p>
<p><img src="http://datapigtechnologies.com/blog/wp-content/uploads/2011/10/102411_1203_FormattingA4.png" alt=""/>
	</p>
<p><span style="color:white">.<br />
</span></p>
<p><span style="color:white">.<br />
</span></p>
<p>Access can handle pretty much any number formatting Excel can.  So you can get just as fancy in Access as you can in Excel.
</p>
<p>For example, I can get fancy and add a &#8220;k&#8221; indicator to all the revenue numbers by changing the format string to this:  <strong>$#,###, &#8220;k&#8221;</strong>.
</p>
<p><img src="http://datapigtechnologies.com/blog/wp-content/uploads/2011/10/102411_1203_FormattingA5.png" alt=""/>
	</p>
<p><span style="color:white">.<br />
</span></p>
<p><span style="color:white">.<br />
</span></p>
<p>And remember, this formatting trick can be applied to Forms and Reports also (simply apply the formatting to their respective Format properties).
</p>
<p><span style="color:white">.<br />
</span></p>
<p>There you have it Christina.  I hope that helped. </p>
<p>Related posts:<ol>
<li><a href='http://datapigtechnologies.com/blog/index.php/documenting-access-queries-in-excel/' rel='bookmark' title='Documenting Access Queries in Excel'>Documenting Access Queries in Excel</a></li>
<li><a href='http://datapigtechnologies.com/blog/index.php/changing-the-sort-order-of-crosstab-column-headings/' rel='bookmark' title='Changing Sort Order of Access Crosstab Headings'>Changing Sort Order of Access Crosstab Headings</a></li>
<li><a href='http://datapigtechnologies.com/blog/index.php/getting-to-workdays-in-access/' rel='bookmark' title='Getting to Workdays in Access'>Getting to Workdays in Access</a></li>
<li><a href='http://datapigtechnologies.com/blog/index.php/replacing-the-microsoft-access-splash-screen/' rel='bookmark' title='Replacing the Microsoft Access Splash Screen'>Replacing the Microsoft Access Splash Screen</a></li>
<li><a href='http://datapigtechnologies.com/blog/index.php/create-a-keyboard-hot-key-to-start-excel-or-access/' rel='bookmark' title='Create a Keyboard Hot Key to Start Excel or Access'>Create a Keyboard Hot Key to Start Excel or Access</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://datapigtechnologies.com/blog/index.php/formatting-access-queries-to-the-thousands-place/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Replacing the Microsoft Access Splash Screen</title>
		<link>http://datapigtechnologies.com/blog/index.php/replacing-the-microsoft-access-splash-screen/</link>
		<comments>http://datapigtechnologies.com/blog/index.php/replacing-the-microsoft-access-splash-screen/#comments</comments>
		<pubDate>Sun, 01 May 2011 23:49:01 +0000</pubDate>
		<dc:creator>datapig</dc:creator>
				<category><![CDATA[Access Tips and Tricks]]></category>
		<category><![CDATA[Access]]></category>
		<category><![CDATA[Tips and Tricks]]></category>

		<guid isPermaLink="false">http://datapigtechnologies.com/blog/index.php/replacing-the-microsoft-access-splash-screen/</guid>
		<description><![CDATA[Many of us have created Microsoft Access applications which are used every day in professional environments. And we all strive to have those applications to look as professional as we can get them. Given all the work we do to give our Access applications a professional look and feel, it is a bit annoying to [...]
Related posts:<ol>
<li><a href='http://datapigtechnologies.com/blog/index.php/finding-and-replacing-nulls-in-access/' rel='bookmark' title='Finding and Replacing Nulls in Access'>Finding and Replacing Nulls in Access</a></li>
<li><a href='http://datapigtechnologies.com/blog/index.php/exorcizing-microsoft-office/' rel='bookmark' title='Exorcizing Microsoft Office'>Exorcizing Microsoft Office</a></li>
<li><a href='http://datapigtechnologies.com/blog/index.php/clearing-access-importerror-tables/' rel='bookmark' title='Clearing Access ImportError Tables'>Clearing Access ImportError Tables</a></li>
<li><a href='http://datapigtechnologies.com/blog/index.php/create-a-keyboard-hot-key-to-start-excel-or-access/' rel='bookmark' title='Create a Keyboard Hot Key to Start Excel or Access'>Create a Keyboard Hot Key to Start Excel or Access</a></li>
<li><a href='http://datapigtechnologies.com/blog/index.php/changing-the-sort-order-of-crosstab-column-headings/' rel='bookmark' title='Changing Sort Order of Access Crosstab Headings'>Changing Sort Order of Access Crosstab Headings</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Many of us have created Microsoft Access applications which are used every day in professional environments. And we all strive to have those applications to look as professional as we can get them. Given all the work we do to give our Access applications a professional look and feel, it is a bit annoying to see the Microsoft Access splash screen pop up each time we open the application.</p>
<p><span id="more-3181"></span></p>
<p>You know…this guy…</p>
<p><img src="http://datapigtechnologies.com/blog/wp-content/uploads/2011/05/050111_2348_Replacingth1.png" alt="" /></p>
<p><span style="color: white;">.<br />
</span></p>
<p>Well, here&#8217;s an old trick you can use to create your own splash screen, effectively suppressing the standard Access splash.</p>
<p><span style="color: white;">.<br />
</span></p>
<p>Simply create a bitmap image you would like to see as your splash screen, naming it the same name as your database.</p>
<p>Then place the splash screen in the same directory as your Access database.</p>
<p><span style="color: white;">.<br />
</span></p>
<p>For example, I have an access database called Tool.mdb. I created this bitmap and named it Tool.bmp, and placed in the same directory.</p>
<p><img src="http://datapigtechnologies.com/blog/wp-content/uploads/2011/05/050111_2348_Replacingth2.png" alt="" /></p>
<p><span style="color: white;">.<br />
</span></p>
<p>Now I see this as my splash screen instead of the default Microsoft Access one.</p>
<p><span style="color: white;">.<br />
</span></p>
<p>Of course, you could always have a bit of fun with your users. Create a splash screen that makes you look like you have real connections with the Microsoft Office development team.</p>
<p><img src="http://datapigtechnologies.com/blog/wp-content/uploads/2011/05/050111_2348_Replacingth3.png" alt="" /></p>
<p><span style="color: white;">.<br />
</span></p>
<p>This trick works in both Access 2003 and 2007 (both mdb and accdb files). I haven&#8217;t tried it with Access 2010 yet. Maybe one of you can let us know if it works there too.</p>
<p>.</p>
<p>Oh…and if you don&#8217;t want to see any splash screen at all, you can simply create a very small bitmap that can hardly be detected when it pops up.</p>
<p>Related posts:<ol>
<li><a href='http://datapigtechnologies.com/blog/index.php/finding-and-replacing-nulls-in-access/' rel='bookmark' title='Finding and Replacing Nulls in Access'>Finding and Replacing Nulls in Access</a></li>
<li><a href='http://datapigtechnologies.com/blog/index.php/exorcizing-microsoft-office/' rel='bookmark' title='Exorcizing Microsoft Office'>Exorcizing Microsoft Office</a></li>
<li><a href='http://datapigtechnologies.com/blog/index.php/clearing-access-importerror-tables/' rel='bookmark' title='Clearing Access ImportError Tables'>Clearing Access ImportError Tables</a></li>
<li><a href='http://datapigtechnologies.com/blog/index.php/create-a-keyboard-hot-key-to-start-excel-or-access/' rel='bookmark' title='Create a Keyboard Hot Key to Start Excel or Access'>Create a Keyboard Hot Key to Start Excel or Access</a></li>
<li><a href='http://datapigtechnologies.com/blog/index.php/changing-the-sort-order-of-crosstab-column-headings/' rel='bookmark' title='Changing Sort Order of Access Crosstab Headings'>Changing Sort Order of Access Crosstab Headings</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://datapigtechnologies.com/blog/index.php/replacing-the-microsoft-access-splash-screen/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Exorcizing Microsoft Office</title>
		<link>http://datapigtechnologies.com/blog/index.php/exorcizing-microsoft-office/</link>
		<comments>http://datapigtechnologies.com/blog/index.php/exorcizing-microsoft-office/#comments</comments>
		<pubDate>Wed, 16 Mar 2011 17:47:41 +0000</pubDate>
		<dc:creator>datapig</dc:creator>
				<category><![CDATA[Access Tips and Tricks]]></category>
		<category><![CDATA[Excel Tips and Tricks]]></category>
		<category><![CDATA[Access]]></category>
		<category><![CDATA[Excel]]></category>
		<category><![CDATA[Tips and Tricks]]></category>

		<guid isPermaLink="false">http://datapigtechnologies.com/blog/index.php/exorcizing-microsoft-office/</guid>
		<description><![CDATA[The other day, a co-worker of mine lost the ability to send an email from Excel. You know…Office button -&#62; Send -&#62; E-mail. He used to be able to do this, but for some reason, things went all wonky and now he can&#8217;t. I guess sometimes Microsoft Office gets a bug up its butt and [...]
Related posts:<ol>
<li><a href='http://datapigtechnologies.com/blog/index.php/avoiding-data-cut-off-in-excel/' rel='bookmark' title='Avoiding Data Cut-Off in Excel'>Avoiding Data Cut-Off in Excel</a></li>
<li><a href='http://datapigtechnologies.com/blog/index.php/create-a-keyboard-hot-key-to-start-excel-or-access/' rel='bookmark' title='Create a Keyboard Hot Key to Start Excel or Access'>Create a Keyboard Hot Key to Start Excel or Access</a></li>
<li><a href='http://datapigtechnologies.com/blog/index.php/cant-export-more-than-65000-rows-to-excel-2007/' rel='bookmark' title='Can’t Export More than 65,000 Rows to Excel 2007?'>Can’t Export More than 65,000 Rows to Excel 2007?</a></li>
<li><a href='http://datapigtechnologies.com/blog/index.php/sorting-numbers-and-text-together/' rel='bookmark' title='Sorting Numbers and Text Together'>Sorting Numbers and Text Together</a></li>
<li><a href='http://datapigtechnologies.com/blog/index.php/break-pivottable-report-filters-into-multiple-columns/' rel='bookmark' title='Break PivotTable Report Filters into Multiple Columns'>Break PivotTable Report Filters into Multiple Columns</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>The other day, a co-worker of mine lost the ability to send an email from Excel. You know…Office button -&gt; Send -&gt; E-mail.</p>
<p>He used to be able to do this, but for some reason, things went all wonky and now he can&#8217;t. I guess sometimes Microsoft Office gets a bug up its butt and starts acting possessed.</p>
<p><span style="color: white;">.<br />
</span></p>
<p>The good news is that Microsoft comes with its very own <a href="http://en.wikipedia.org/wiki/Lankester_Merrin" target="_blank">Father Merrin</a> who can exorcize Office, returning it to the happy little girl it usually is. Yes…Microsoft Office is a girl.</p>
<p><span style="color: white;">.<br />
</span></p>
<p>Microsoft Office comes with a built in tool called Diagnostics (or Detect and Repair). This tool is designed to (according to Microsoft):   &#8220;<em>solve some problems directly and might identify ways that you can solve other problems.&#8221;<br />
</em><br />
<span id="more-3100"></span><br />
In other words:  &#8220;we&#8217;ll take a shot at fixing issues, but after this&#8230;you&#8217;re on your own&#8221;.</p>
<p><span style="color: white;">.<br />
</span></p>
<p>If you&#8217;re experiencing strange issues with Excel 2007, you can usually fix them by calling up the Microsoft Office Diagnostics tool.</p>
<p>Click the Office Button -&gt; Excel Options -&gt; Resources -&gt; Diagnose</p>
<p><img src="http://datapigtechnologies.com/blog/wp-content/uploads/2011/03/031611_1747_ExorcizingM1.png" alt="" /></p>
<p><span style="color: white;">.<br />
</span></p>
<p>In Excel 2003, you can go up to the menu bar and click Help -&gt; Detect and Repair.</p>
<p><img src="http://datapigtechnologies.com/blog/wp-content/uploads/2011/03/031611_1747_ExorcizingM2.png" alt="" /></p>
<p><span style="color: white;">.<br />
</span></p>
<p>Strangely enough, Excel 2010 doesn&#8217;t seem to have a Diagnostics feature.</p>
<p>But according to <a href="http://rogersaccessblog.blogspot.com/2010/08/access-2010-detect-and-repair.html" target="_blank">Access MVP, Roger</a>, you can run this piece of code in Excel 2010 and get the old Detect and Repair feature.</p>
<p>I&#8217;ve tested the code and it does indeed bring up the Detect and Repair dialog box, but I haven&#8217;t run an actual detect and repair in Excel 2010 yet.</p>
<p style="background: white;"><span style="color: #222222;"><strong>Function Detect_Repair()<br />
Application.CommandBars.FindControl(ID:=3774).Execute<br />
End Function<br />
</strong></span></p>
<p style="background: white;"><span style="color: white;"><strong><span style="color: #ffffff;">.<br />
</span></strong></span></p>
<p style="background: white;"><span style="color: white;"><strong><span style="color: #ffffff;">.</span><br />
</strong></span></p>
<p style="background: white;"><span style="color: #222222;">Anyway…I did run the Excel Diagnostic on my co-</span>worker&#8217;s Excel 2007, and he regained the ability to send an email from Excel.</p>
<p style="background: white;">Thanks Father Merrin!</p>
<p style="background: white;"> </p>
<p style="background: white;"> </p>
<p>Related posts:<ol>
<li><a href='http://datapigtechnologies.com/blog/index.php/avoiding-data-cut-off-in-excel/' rel='bookmark' title='Avoiding Data Cut-Off in Excel'>Avoiding Data Cut-Off in Excel</a></li>
<li><a href='http://datapigtechnologies.com/blog/index.php/create-a-keyboard-hot-key-to-start-excel-or-access/' rel='bookmark' title='Create a Keyboard Hot Key to Start Excel or Access'>Create a Keyboard Hot Key to Start Excel or Access</a></li>
<li><a href='http://datapigtechnologies.com/blog/index.php/cant-export-more-than-65000-rows-to-excel-2007/' rel='bookmark' title='Can’t Export More than 65,000 Rows to Excel 2007?'>Can’t Export More than 65,000 Rows to Excel 2007?</a></li>
<li><a href='http://datapigtechnologies.com/blog/index.php/sorting-numbers-and-text-together/' rel='bookmark' title='Sorting Numbers and Text Together'>Sorting Numbers and Text Together</a></li>
<li><a href='http://datapigtechnologies.com/blog/index.php/break-pivottable-report-filters-into-multiple-columns/' rel='bookmark' title='Break PivotTable Report Filters into Multiple Columns'>Break PivotTable Report Filters into Multiple Columns</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://datapigtechnologies.com/blog/index.php/exorcizing-microsoft-office/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Capture a User’s Domain\UserName</title>
		<link>http://datapigtechnologies.com/blog/index.php/capture-a-users-domainusername/</link>
		<comments>http://datapigtechnologies.com/blog/index.php/capture-a-users-domainusername/#comments</comments>
		<pubDate>Mon, 28 Feb 2011 07:02:46 +0000</pubDate>
		<dc:creator>datapig</dc:creator>
				<category><![CDATA[Access VBA]]></category>
		<category><![CDATA[Excel VBA]]></category>
		<category><![CDATA[Access]]></category>
		<category><![CDATA[Excel]]></category>
		<category><![CDATA[Power Tips]]></category>
		<category><![CDATA[VBA]]></category>

		<guid isPermaLink="false">http://datapigtechnologies.com/blog/?p=3078</guid>
		<description><![CDATA[When developing your Excel or Access application, it&#8217;s not uncommon to need to capture your user&#8217;s domain/username for one reason or another. A user&#8217;s domain/username combination is the traditional unique identifier for a user - often captured by programmers to do things in like: Help manage user login and permissions Create a history of who used the [...]
Related posts:<ol>
<li><a href='http://datapigtechnologies.com/blog/index.php/removing-user-name-from-comments/' rel='bookmark' title='Removing User Name from Comments'>Removing User Name from Comments</a></li>
<li><a href='http://datapigtechnologies.com/blog/index.php/creating-and-using-user-defined-functions-in-access/' rel='bookmark' title='Creating and Using User Defined Functions in Access'>Creating and Using User Defined Functions in Access</a></li>
<li><a href='http://datapigtechnologies.com/blog/index.php/vbe-tips-i-wish-i-knew-5-years-ago/' rel='bookmark' title='VBE Tips I Wish I Knew 5 Years Ago'>VBE Tips I Wish I Knew 5 Years Ago</a></li>
<li><a href='http://datapigtechnologies.com/blog/index.php/hack-windows-authentication-for-your-applications/' rel='bookmark' title='Use Windows Authentication for your Excel and Access Applications'>Use Windows Authentication for your Excel and Access Applications</a></li>
<li><a href='http://datapigtechnologies.com/blog/index.php/running-an-excel-macro-from-access-or-another-excel-workbook/' rel='bookmark' title='Running an Excel Macro from Access (or Another Excel Workbook)'>Running an Excel Macro from Access (or Another Excel Workbook)</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>When developing your Excel or Access application, it&#8217;s not uncommon to need to capture your user&#8217;s domain/username for one reason or another. A user&#8217;s domain/username combination is the traditional unique identifier for a user - often captured by programmers to do things in like:</p>
<ul>
<li>
<div style="margin-left: 36pt;">Help manage user login and permissions</div>
</li>
<li>
<div style="margin-left: 36pt;">Create a history of who used the application</div>
</li>
<li>
<div style="margin-left: 36pt;">Capture the name of each user who made the changes to data</div>
</li>
<li>
<div style="margin-left: 36pt;">Personalize outputs and program messages for users</div>
</li>
</ul>
<p><span style="color: white;">.<br />
</span>There are literally half a dozen ways to capture a user&#8217;s domain name and user name. In this post, I&#8217;ll give you a very easy method using the <strong>Environ</strong> function.</p>
<p><span style="color: white;">.<span id="more-3078"></span><br />
</span></p>
<p>Environ stands for Environment, and refers to environment variables in an operating system. Environment variables are specially named aliases for specific system properties, exposed as a kind of shortcut for system administrators and programmers.</p>
<p><span style="color: white;">.<br />
</span></p>
<p>Although majority of these Environment variables are useless to your average Excel/Access developer. There are a few that can prove to be useful. Two of these are the UserDomain and UserName variables. We can use these to capture a user&#8217;s Domain\UserName.</p>
<p>To demonstrate this, I&#8217;ve entered the following function into a standard module.</p>
<p><strong><em>Function getReturnUName()<br />
getReturnUName = Environ(&#8220;UserDomain&#8221;) &amp; &#8220;\&#8221; &amp; Environ(&#8220;Username&#8221;)<br />
End Function<br />
</em></strong></p>
<p><span style="color: white;">.<br />
</span></p>
<p>Now all I have to do is call the function to capture an active user&#8217;s Domain\Username.</p>
<p><img src="http://datapigtechnologies.com/blog/wp-content/uploads/2011/02/022811_0702_CaptureaUse1.png" alt="" /><strong><em><br />
</em></strong></p>
<p><span style="color: white;">.<br />
</span></p>
<p>In Access, you can of course call this function from a Query, Form, or Report.</p>
<p><img src="http://datapigtechnologies.com/blog/wp-content/uploads/2011/02/022811_0702_CaptureaUse2.png" alt="" /></p>
<p><span style="color: white;">.<br />
</span></p>
<p>Here are some of the Environ variables that I&#8217;ve used in the past.</p>
<div>
<table style="border-collapse: collapse;" border="0">
<colgroup span="1">
<col style="width: 189px;" span="1"></col>
<col style="width: 379px;" span="1"></col>
</colgroup>
<tbody>
<tr style="background: #cccccc; height: 20px;">
<td style="padding-left: 7px; padding-right: 7px; border: solid black 0.5pt;" valign="middle"><span style="color: black;"><strong>Variable</strong></span></td>
<td style="padding-left: 7px; padding-right: 7px; border-top: solid black 0.5pt; border-left: none; border-bottom: solid black 0.5pt; border-right: solid black 0.5pt;" valign="middle">
<p style="text-align: center;"><span style="color: black;"><strong>Typical value (May vary, depending on system)</strong></span></p>
</td>
</tr>
<tr style="height: 21px;">
<td style="padding-left: 7px; padding-right: 7px; border-top: none; border-left: solid black 0.5pt; border-bottom: solid black 0.5pt; border-right: solid black 0.5pt;" valign="bottom"><span style="color: black;">Environ(&#8220;ALLUSERSPROFILE&#8221;)</span></td>
<td style="padding-left: 7px; padding-right: 7px; border-top: none; border-left: none; border-bottom: solid black 0.5pt; border-right: solid black 0.5pt;" valign="bottom"><span style="color: black;">C:\Documents and Settings\All Users</span></td>
</tr>
<tr style="height: 20px;">
<td style="padding-left: 7px; padding-right: 7px; border-top: none; border-left: solid black 0.5pt; border-bottom: solid black 0.5pt; border-right: solid black 0.5pt;" valign="bottom"><span style="color: black;">Environ(&#8220;COMPUTERNAME&#8221;)</span></td>
<td style="padding-left: 7px; padding-right: 7px; border-top: none; border-left: none; border-bottom: solid black 0.5pt; border-right: solid black 0.5pt;" valign="bottom"><span style="color: black;"><em>{computername}</em></span></td>
</tr>
<tr style="height: 21px;">
<td style="padding-left: 7px; padding-right: 7px; border-top: none; border-left: solid black 0.5pt; border-bottom: solid black 0.5pt; border-right: solid black 0.5pt;" valign="bottom"><span style="color: black;">Environ(&#8220;HOMEDRIVE&#8221;)</span></td>
<td style="padding-left: 7px; padding-right: 7px; border-top: none; border-left: none; border-bottom: solid black 0.5pt; border-right: solid black 0.5pt;" valign="bottom"><span style="color: black;">C:</span></td>
</tr>
<tr style="height: 21px;">
<td style="padding-left: 7px; padding-right: 7px; border-top: none; border-left: solid black 0.5pt; border-bottom: solid black 0.5pt; border-right: solid black 0.5pt;" valign="bottom"><span style="color: black;">Environ(&#8220;HOMEPATH&#8221;)</span></td>
<td style="padding-left: 7px; padding-right: 7px; border-top: none; border-left: none; border-bottom: solid black 0.5pt; border-right: solid black 0.5pt;" valign="bottom"><span style="color: black;">\Documents and Settings\<em>{username}</em></span></td>
</tr>
<tr style="height: 21px;">
<td style="padding-left: 7px; padding-right: 7px; border-top: none; border-left: solid black 0.5pt; border-bottom: solid black 0.5pt; border-right: solid black 0.5pt;" valign="bottom"><span style="color: black;">Environ(&#8220;PROGRAMFILES&#8221;)</span></td>
<td style="padding-left: 7px; padding-right: 7px; border-top: none; border-left: none; border-bottom: solid black 0.5pt; border-right: solid black 0.5pt;" valign="bottom"><span style="color: black;">Directory containing program files, usually C:\Program Files </span></td>
</tr>
<tr style="height: 20px;">
<td style="padding-left: 7px; padding-right: 7px; border-top: none; border-left: solid black 0.5pt; border-bottom: solid black 0.5pt; border-right: solid black 0.5pt;" valign="bottom"><span style="color: black;">Environ(&#8220;USERDOMAIN&#8221;)</span></td>
<td style="padding-left: 7px; padding-right: 7px; border-top: none; border-left: none; border-bottom: solid black 0.5pt; border-right: solid black 0.5pt;" valign="bottom"><em>{domain name}</em></td>
</tr>
<tr style="height: 20px;">
<td style="padding-left: 7px; padding-right: 7px; border-top: none; border-left: solid black 0.5pt; border-bottom: solid black 0.5pt; border-right: solid black 0.5pt;" valign="bottom"><span style="color: black;">Environ(&#8220;USERNAME&#8221;)</span></td>
<td style="padding-left: 7px; padding-right: 7px; border-top: none; border-left: none; border-bottom: solid black 0.5pt; border-right: solid black 0.5pt;" valign="bottom"><span style="color: black;"><em>{username}</em></span></td>
</tr>
<tr style="height: 21px;">
<td style="padding-left: 7px; padding-right: 7px; border-top: none; border-left: solid black 0.5pt; border-bottom: solid black 0.5pt; border-right: solid black 0.5pt;" valign="bottom"><span style="color: black;">Environ(&#8220;USERPROFILE&#8221;)</span></td>
<td style="padding-left: 7px; padding-right: 7px; border-top: none; border-left: none; border-bottom: solid black 0.5pt; border-right: solid black 0.5pt;" valign="bottom"><span style="color: black;">C:\Documents and Settings\<em>{username}</em></span></td>
</tr>
</tbody>
</table>
</div>
<p><span style="color: #ffffff;"> .</span></p>
<p> Try them out&#8230;these are fun for the entire family.</p>
<p>Related posts:<ol>
<li><a href='http://datapigtechnologies.com/blog/index.php/removing-user-name-from-comments/' rel='bookmark' title='Removing User Name from Comments'>Removing User Name from Comments</a></li>
<li><a href='http://datapigtechnologies.com/blog/index.php/creating-and-using-user-defined-functions-in-access/' rel='bookmark' title='Creating and Using User Defined Functions in Access'>Creating and Using User Defined Functions in Access</a></li>
<li><a href='http://datapigtechnologies.com/blog/index.php/vbe-tips-i-wish-i-knew-5-years-ago/' rel='bookmark' title='VBE Tips I Wish I Knew 5 Years Ago'>VBE Tips I Wish I Knew 5 Years Ago</a></li>
<li><a href='http://datapigtechnologies.com/blog/index.php/hack-windows-authentication-for-your-applications/' rel='bookmark' title='Use Windows Authentication for your Excel and Access Applications'>Use Windows Authentication for your Excel and Access Applications</a></li>
<li><a href='http://datapigtechnologies.com/blog/index.php/running-an-excel-macro-from-access-or-another-excel-workbook/' rel='bookmark' title='Running an Excel Macro from Access (or Another Excel Workbook)'>Running an Excel Macro from Access (or Another Excel Workbook)</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://datapigtechnologies.com/blog/index.php/capture-a-users-domainusername/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Changing Sort Order of Access Crosstab Headings</title>
		<link>http://datapigtechnologies.com/blog/index.php/changing-the-sort-order-of-crosstab-column-headings/</link>
		<comments>http://datapigtechnologies.com/blog/index.php/changing-the-sort-order-of-crosstab-column-headings/#comments</comments>
		<pubDate>Mon, 14 Feb 2011 10:40:32 +0000</pubDate>
		<dc:creator>datapig</dc:creator>
				<category><![CDATA[Access Queries]]></category>
		<category><![CDATA[Access Tips and Tricks]]></category>
		<category><![CDATA[Access]]></category>
		<category><![CDATA[Queries]]></category>
		<category><![CDATA[Tips and Tricks]]></category>

		<guid isPermaLink="false">http://datapigtechnologies.com/blog/index.php/changing-the-sort-order-of-crosstab-column-headings/</guid>
		<description><![CDATA[By default, Access Crosstab queries sort their column headings in alphabetical order. This is becomes a real drag when you&#8217;re struggling to show months in month order instead of alphabetical order. . This screenshot shows the mess that comes from running a Crosstab with month columns. According to Access, April is the first month of [...]
Related posts:<ol>
<li><a href='http://datapigtechnologies.com/blog/index.php/getting-to-workdays-in-access/' rel='bookmark' title='Getting to Workdays in Access'>Getting to Workdays in Access</a></li>
<li><a href='http://datapigtechnologies.com/blog/index.php/create-a-keyboard-hot-key-to-start-excel-or-access/' rel='bookmark' title='Create a Keyboard Hot Key to Start Excel or Access'>Create a Keyboard Hot Key to Start Excel or Access</a></li>
<li><a href='http://datapigtechnologies.com/blog/index.php/creating-access-udfs-that-accept-arguments/' rel='bookmark' title='Creating Access UDFs that Accept Arguments'>Creating Access UDFs that Accept Arguments</a></li>
<li><a href='http://datapigtechnologies.com/blog/index.php/running-an-access-parameter-query-from-excel/' rel='bookmark' title='Running an Access Parameter Query from Excel'>Running an Access Parameter Query from Excel</a></li>
<li><a href='http://datapigtechnologies.com/blog/index.php/documenting-access-queries-in-excel/' rel='bookmark' title='Documenting Access Queries in Excel'>Documenting Access Queries in Excel</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>By default, Access Crosstab queries sort their column headings in alphabetical order. This is becomes a real drag when you&#8217;re struggling to show months in month order instead of alphabetical order.</p>
<p><span style="color: #ffffff;">.</span></p>
<p>This screenshot shows the mess that comes from running a Crosstab with month columns. According to Access, April is the first month of the year.<br />
<span id="more-3051"></span><br />
<img src="http://datapigtechnologies.com/blog/wp-content/uploads/2011/02/021411_1040_Changingthe1.png" alt="" /></p>
<p><span style="color: white;">.<br />
</span></p>
<p><span style="color: white;">.<br />
</span></p>
<p>The good news is you can customize the sort order of Crosstab column headings.</p>
<p><span style="color: white;">.<br />
</span></p>
<p><strong>Step 1:</strong> Go into the design view of your Crosstab query, right-click the grey area, and then select Properties.</p>
<p><img src="http://datapigtechnologies.com/blog/wp-content/uploads/2011/02/021411_1040_Changingthe2.png" alt="" /></p>
<p><span style="color: white;">.<br />
</span></p>
<p><span style="color: white;">.<br />
</span></p>
<p><strong>Step 2:</strong> In the Column Headings property, enter the month columns in the order you would like to see them.</p>
<p>For example: &#8220;Jan&#8221;,&#8221;Feb&#8221;,&#8221;Mar&#8221;,&#8221;Apr&#8221;,&#8221;May&#8221;,&#8221;Jun&#8221;, &#8220;Jul&#8221;,&#8221;Aug&#8221;,&#8221;Sep&#8221;,&#8221;Oct&#8221;,&#8221;Nov&#8221;,&#8221;Dec&#8221;</p>
<p><img src="http://datapigtechnologies.com/blog/wp-content/uploads/2011/02/021411_1040_Changingthe3.png" alt="" /></p>
<p><span style="color: white;">.<br />
</span></p>
<p><span style="color: white;">.<br />
</span></p>
<p><span style="color: white;">.</span><strong> Step 3:</strong> Run the query to see your genius up close.</p>
<p><img src="http://datapigtechnologies.com/blog/wp-content/uploads/2011/02/021411_1040_Changingthe4.png" alt="" /></p>
<p><span style="color: white;">.<br />
</span></p>
<p><span style="color: white;">.<br />
</span></p>
<p>A couple of notes to keep in mind:</p>
<p>1) You must enter each column name in quotes and separate each column with commas.</p>
<p><span style="color: white;">.<br />
</span></p>
<p>2) Accidentally misspelling a column name will result in that column being excluded from the crosstab. Instead, you&#8217;ll get a dummy column with the misspelled name being included with no data in it.</p>
<p><span style="color: white;">.<br />
</span></p>
<p>3) You must enter every column you want include in your crosstab report. Excluding a column will exclude that column from the crosstab results.</p>
<p><span style="color: white;">.<br />
</span></p>
<p>4) Clearing the Column Headings attribute will naturally return Access to the default behavior (displaying columns in alphabetical order).</p>
<p>Related posts:<ol>
<li><a href='http://datapigtechnologies.com/blog/index.php/getting-to-workdays-in-access/' rel='bookmark' title='Getting to Workdays in Access'>Getting to Workdays in Access</a></li>
<li><a href='http://datapigtechnologies.com/blog/index.php/create-a-keyboard-hot-key-to-start-excel-or-access/' rel='bookmark' title='Create a Keyboard Hot Key to Start Excel or Access'>Create a Keyboard Hot Key to Start Excel or Access</a></li>
<li><a href='http://datapigtechnologies.com/blog/index.php/creating-access-udfs-that-accept-arguments/' rel='bookmark' title='Creating Access UDFs that Accept Arguments'>Creating Access UDFs that Accept Arguments</a></li>
<li><a href='http://datapigtechnologies.com/blog/index.php/running-an-access-parameter-query-from-excel/' rel='bookmark' title='Running an Access Parameter Query from Excel'>Running an Access Parameter Query from Excel</a></li>
<li><a href='http://datapigtechnologies.com/blog/index.php/documenting-access-queries-in-excel/' rel='bookmark' title='Documenting Access Queries in Excel'>Documenting Access Queries in Excel</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://datapigtechnologies.com/blog/index.php/changing-the-sort-order-of-crosstab-column-headings/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

