Access Expert Tutorial

Implementing the Microsoft Access database program.

Commenting Code

 Putting `comments` in your code isn't just for code that you're going to share with other developers; it's a way for you to be able to understand what you wrote yesterday next week.

There is no use coming up with a kick-ass algorithm if you don't remember how to use it. Make yourself a friendly note explaining why and how. It is a kindness to your future self.

Don't be so clever that you write code that is useless to you later.

Google Quick Search Box for Windows

To install:
  1. Download it! (Click here)
  2. Open up Command Prompt (Win+R and type 'cmd' and press Enter)
  3. Navigate in Command Prompt to where the file is saved, e.g., 'CD C:/Users/user/Downloads'
  4. Copy and paste: googlequicksearchboxsetup.exe /install /bundle=tbie /global /brand=GGLL /hl=en
  5. Press Return
Quick Search will be installed and you will then be able to configure it from the little button that appeared on your start menu.

To uninstall: 
  1. Open a command prompt
  2. Copy and paste:googlequicksearchboxsetup.exe /uninstall /bundle=tbie /global
  3. Press Return
=================================================
Thanks to JAMES DOC "Christian · Blogger · Web Developer · Geek"

The SQL Distinct Key Word

This solution is for returning one record per user with either a min or max value in one of the record's fields.

---------------------------------------------------------------
SELECT DISTINCT ON (P.ID) PR.PRACTICENAME AS "Practice", P.FIRSTNAME AS "First Name", P.MIDDLENAME AS "Middle Name", P.LASTNAME AS "Last Name", A.DATE::date AS "Last Appointment Date"

FROM PEOPLE AS P
JOIN CLIENT C ON C.ID = P.CLIENT_ID
JOIN PRACTICE PR ON PR.ID = P.PRACTICE_ID
JOIN APPOINTMENT A ON A.CLIENT_ID = C.ID

WHERE A.DATE IS NOT NULL

ORDER BY P.ID, A.DATE DESC
--------------------------------------------------------------- 

The beauty of this query is that is returns only the record for each client's latest appointment without  the use of complex sub-queries. Granted, the results may have to be further sorted, either using SQL or another tool, but it does return only one row per CLIENT and that row is for their LATEST appointment date.

Douglas Crockford: The JavaScript Programming Language

This lecture is a complete overview of the JavaScript (ECMAScript) language from a very knowledgeable and experienced leader in the field.



Enhanced by Zemanta

Excel Parsing Formulae

Parse rightmost word in a cell:
=RIGHT(A1, LEN(A1)-FIND("*",SUBSTITUTE(A1," ", "*",LEN(A1)-LEN(SUBSTITUTE(A1," ",""))))

Parse location:
=MID(A2,FIND("Location: ",A2,1)+14,FIND("(",A2,FIND("Location: ",A2,1))-FIND("Location: ",A2,1)-14)
=MID(A2,FIND("Location: ",A2,1)+14,FIND("(",A2,FIND("Location: ",A2,1))-FIND("Location: ",A2,1)-14)
[ Number of characters: FIND("(",A2,FIND("Location: ",A2,1))-FIND("Location: ",A2,1)-15 ]

ParseName(fwd):
=PROPER(MID(A2,SEARCH("Name: ",A2,1)+6,SEARCH("Email:",A2,1)-(SEARCH("Name:",A2,1)+9)))
=PROPER(MID(A2,SEARCH("Name: ",A2,1)+6,SEARCH("Phone:",A2,1)-(SEARCH("Name:",A2,1)+8)))

ParseEmail:
=TRIM(LOWER(MID(A2,FIND("mailto:",A2,1)+7,(FIND("Home Location: ",A2,1))-(FIND("mailto:",A2,1)+9))))
=TRIM(LOWER(MID(A2,FIND("Email: ",A2,1)+8,(FIND("Phone: ",A2,1))-(FIND("Email: ",A2,1)+12))))

Concatenate middle and last names (& appellations):
=PROPER(TRIM(CONCATENATE(IF(LEN(C2)=1,C2&".",C2),IF(ISBLANK(D2),""," "&D2),IF(ISBLANK(E2),""," "&E2),)))
=PROPER(TRIM(CONCATENATE(IF(LEN(C2)=1,C2&".",C2),IF(ISBLANK(D2),""," "&D2),IF(ISBLANK(E2),""," "&E2),IF(ISBLANK(F2),""," "&F2))))
=PROPER(TRIM(CONCATENATE(IF(LEN(D2)=1,D2&".",D2),IF(ISBLANK(E2),""," "&E2),IF(ISBLANK(F2),""," "&F2))))
=PROPER(TRIM(CONCATENATE(IF(LEN(E2)=1,E2&".",E2),IF(ISBLANK(F2),""," "&F2),IF(ISBLANK(G2),""," "&G2))))
=PROPER(TRIM(CONCATENATE(IF(LEN(F2)=1,F2&".",F2),IF(ISBLANK(G2),""," "&G2),IF(ISBLANK(H2),""," "&H2))))
=PROPER(TRIM(CONCATENATE(IF(LEN(F2)=1,F2&".",F2),IF(ISBLANK(G2),""," "&G2),IF(ISBLANK(H2),""," "&H2),IF(ISBLANK(I2),""," "&I2))))
=PROPER(TRIM(CONCATENATE(IF(LEN(G2)=1,G2&".",G2),IF(ISBLANK(H2),""," "&H2),IF(ISBLANK(I2),""," "&I2))))
=PROPER(TRIM(CONCATENATE(IF(LEN(G2)=1,G2&".",G2),IF(ISBLANK(H2),""," "&H2),IF(ISBLANK(I2),""," "&I2),IF(ISBLANK(J2),""," "&J2))))

Parse location (in Body):
=MID(A2,FIND("Location: ",A2,1)+13,FIND("(",A2,FIND("Location: ",A2,1))-FIND("Location: ",A2,1)-14)

Parse location (in Subject):
=IF(SEARCH(" in ",A2,1),RIGHT(A2,LEN(A2)-SEARCH(" in ",A2,1)-3),)
=IF(SEARCH(" in ",C2,1),RIGHT(C2,LEN(C2)-SEARCH(" in ",C2,1)-3),)
=IF(SEARCH(" in ",D2,1),RIGHT(D2,LEN(D2)-SEARCH(" in ",D2,1)-3),)
=IF(SEARCH(" in ",C2,1),RIGHT(C2,LEN(C2)-SEARCH(" in ",C2,1)-3),IF(SEARCH(" for ",C2,1),RIGHT(C2,LEN(C2)-SEARCH(" for ",C2,1)-4),))
=IF(SEARCH(" in ",D2,1),RIGHT(D2,LEN(D2)-SEARCH(" in ",D2,1)-3),IF(SEARCH(" for ",D2,1),RIGHT(D2,LEN(D2)-SEARCH(" for ",D2,1)-4),))
-------------------------------------------------

View Source Bookmarklet for iPhone

var sourceWindow = window.open("about:blank"); var newDoc = sourceWindow.document; newDoc.open(); newDoc.write("<html><head><title>Source of " + document.location.href + "</title><meta name=\"viewport\" id=\"viewport\" content=\"initial-scale=1.0;" + "user-scalable=0; maximum-scale=0.6667; width=480\"/><script>function do_onload()" + "{setTimeout(function(){window.scrollTo(0,1);},100);}if(navigator.userAgent.indexOf" + "(\"iPhone\")!=-1)window.onload=do_onload;</script></head><body></body></html>");

From Evernote:

View Source Bookmarklet

Clipped from: http://www.iphonewebdev.com/examples/
var sourceWindow = window.open("about:blank");var newDoc = sourceWindow.document; newDoc.open(); newDoc.write("<html><head><title>Source of " +document.location.href + "</title><meta name=\"viewport\" id=\"viewport\" content=\"initial-scale=1.0;" + "user-scalable=0; maximum-scale=0.6667; width=480\"/><script>function do_onload()" +"{setTimeout(function(){window.scrollTo(0,1);},100);}if(navigator.userAgent.indexOf"+ "(\"iPhone\")!=-1)window.onload=do_onload;</script></head><body></body></html>"); 

HTML and JavaScript for parsing E-mails and URLs

HTML part:
<textarea name="Block2" rows="20" cols="50"></textarea><br />
Enter a regular expression type:
<select name="re" onchange="parseWith()">
  <option value="^\W" selected="selected">Choose an expression</option>
  <option value="[\w\.\-]+@[\w\.\-]+\b">E-mails</option>
  <option value="\w{3,6}:/+[\w.]*">URLs</option>
</select><br />
<form name="outform"><textarea name='result' rows='20' cols='50'></textarea></form>
 
JavaScript part:
function parseWith(){
 var txtI = document.text2.Block2.value;
 var re = document.text2.re.value;
 var use = new RegExp(re,"g"); // RegExp constructor compiles entered value to a JavaScript valid regex
 var txtO = txtI.match(use);
  document.outform.result.value = txtO;
 replaceCommas();
}

function replaceCommas(){
 var txt = document.outform.result.value;
 var re = /,/g;
 var rTxt = txt.replace(re,"\n");
  document.outform.result.value = rTxt;
 var para = document.getElementById("label");
 para.lastChild.nodeValue = "";
 para.lastChild.nodeValue = "paragraph separated values";
}

Most Useful Color Site on the Web

Most useful and amazingly generous Website I have ever found for experimenting with color.
Thank you Peter Stanicek!