Wednesday, May 30, 2012

Access 2007: File Size Stays The Same After Deleting Records

Problem:  An Access database file has gotten large, so you decide to delete many records to reduce the file size.  After doing so, however, the file size stays the same.

Solution:  Compact and repair the database.

1)  Go to the Office button in the upper-left.
2)  Go to Manage and select "Compact and Repair Database".

Your database will now be a smaller size, sometimes even if you didn't delete any records. 

To make this automatic:

1)  Go to the Office button in the upper-left and click the "Access Options" button.
2)  Select "Current Database" from the left-hand menu.
3)  Check the box "Compact On Close" and click OK.

Wednesday, May 16, 2012

Access: Auto-Populate Fields in a Form Based on ComboBox Selection

This post outlines how to automatically fill other fields in a form based on a selection made from a ComboBox.

1)  While in Design View, select the ComboBox from which you will use to fill in the rest of the fields.  All this data must exist in the same table for this method to work.

2)  On the Property Sheet, select the Data tab and click the "..." button next to Row Source.  The "Show Table" dialog should appear asking you which table to select from.  Choose the apporiate table.

3)  Drag and drop the column headers that will be used for filling in the data and save the query.

4)  Go to the Format tab in the Property Sheet.  Change the Column Count to the number of columns you selected in step 3.  Change the Column Widths to be 1 for the column you want to be selectable from the drop down and 0 for each column you want hidden.  For example, I want my first row to be the list used in the Combobox, but I listed two additional columns, so my Column Widths will look like this:  1";0";0".

The 0 values are just making the data available to use when we auto-fill later on.

5)  Go to the Event tab and click on the "..." button for "After Update" and select Code Builder.  This will bring up the Microsoft Visual Basic interface.

6)  You shold see a section beginning with "Private Sub COMBOBOX1_AfterUpdate()". Below that and before "End Sub", type the following:


Me.[TEXT BOX] = Me.[COMBOBOX1].Column(1)
 
"TEXT BOX" is the label for the box you wish to fill automatically fill.
"COMBOX1" is the name of the combobox where the selection was made to fill the rest of the boxes.
"Column(1)" indicates which column from the hidden areas of COMBOBOX to fill this box with.  Note that the column counts begins at 0, so above the 1 indicates the second column.
 
To continue, you could add another text box that automatically gets filled by typing the following:
 
Me.[TEXT BOX2] = Me.[COMBOBOX1].Column(2)
 
7)  Go back to Form View and try it out.  I may add some screen shots at a later time, but in the meantime, please post comment with questions for clarity.
 
An advantage of using this method is that it frees up the Control Source field in the Property Sheet so that any data entered and automatically filled can still be stored to a table for other reports.

Tuesday, May 15, 2012

Windows XP/7: How to Prevent Flash Drive Viruses Forever!

One of the most common ways for offices to get a virus outbreak is through flash drives.  For some reason many of the big anti-virus companies haven't tarket flash drive viruses and instead focus on web browsing and emails.  Fair enough, but the flash drive solution is rather simple:

How do viruses spread through flash drives?  Through a "feature" in Windows that allows software to automatically and easily run from a flash drive, CD or DVD simply by inserting it in the computer.  On a more technical note, Windows looks for a file called autorun.inf that maps the execution out for the user.

The problem is that viruses can replace or create autorun.inf to run malicious programs from the flash drive.  I say the tradeoff of convenience over security is not worth it, so let's disable Window's use of autorun.inf and forever be rid of the problem with flash drive viruses!

There used to be a registry script that would make this possible, but it seems the Microsoft has embraced the move to disable autorun.inf, so the solution is rather straight forward.

For very technical background info, read this page from Microsoft.

Down the middle of the page you'll see a button saying "Fix It" under the heading "Disable Autoplay".  This is the one you want.  Or simply click here to directly install it.

That's it!  No more viruses!

To clean existing flash drives, I have found Microsoft Security Essentials to do the best job.  I don't know why, but McAfee and other big anti-virus brands just don't seem to care what's on your flash drive.

iPhone: Broken Mute Switch / Bypass Silent Toggle

I inherited a much-appreciated iPhone 3GS recently with the warning that it came with some minor problems, including a silent switch that didn't work. 

The symptom:  while it works in the "on" position, the "off" position was unreliable or irritating as it would go crazy vibrating as it contanstly switched on and off from silent.

The solution:

1)  Download and install "SBSettings" from Cydia.  (Oh yeah, jailbreak your iPhone first).

2)  Download and install "Ringer/Silent SBSettings" from Cydia.

Now when you swipe the top of your iPhone screen, you will see a picture of a bell.  This will toggle between muting and ringing.

Since the switch always worked in the "on" state, I just always leave the switch on and use the toggle to make it turn on or off.  How you use this software will depend on what exactly is happening with your switch, but you'll figure out what's best for you.

The good thing about this fix is that it works for all versions of iPhones.  There's rumor of an "AutoSilent" app that does wonders, but it wouldn't work on my iPhone.

Monday, May 14, 2012

Unlock iPhone 3G iOS 4.2.1 Baseband 05.15.04

I went to unlock an iPhone 3G I found on a volcano (true story) and it seemed to go without a hitch...except when I tried to actually use the phone on a network.  Even though it acted like it was jailbroken and ultrasn0w unlocked it, the phone never would actually work on the network.  After some research, I discovered there's a bug with baseband 05.15.04.

The fix seemed simple:  while jailbreaking with Redsn0w, install the iPad baseband.  The problem with this fix? The latest version of Resn0w kept crashing when trying to jailbreak with the iPad baseband.  I also saw a fair share of running pineapples that didn't seem to be running anywhere and continuously rebooting Apple logos.

So after a lot of research and trial and error, it took the right combination of iOS and version of Redsn0w to work.  I give you my solution:

1)  Download iOS 4.2.1 IPSW here.

2)  Download Redsn0w 9.6b5 here.

3)  Run Resn0w 9.6b5 and select the IPSW downloaded in Step 1.

4)  When asked to select your options, check "Install Cydia" and "Install iPad Baseband".

5)  Continue to follow the rest of the instructions to jailbreak your iPhone.

6)  Open Cydia and install ultrasn0w.

You'll be unlocked!

Sunday, May 6, 2012

Download Anki Decks from Web/Browser

If you have ever encountered a annoying and nondescript message from Anki when trying to download a deck, give this a try.  I came about it when I realized one of the offices I work in had blocked access to Anki's download repository.  There are other solutions involving firewalls and anti-virus blocks, but this just gets straight to the point:

1)  In your browser, go to http://anki.ichi2.net/file/search .

2)  It's all a big running text file, but you can search for certain phrases.  For example, I searched for "French" and scanned through the matches until I found a couple decks I wanted to try out.  Here is my example:

 [579, null, "HTAL French ", "A compilation of other decks as well as a few facts I've added myself. Deck is incomplete as of October 2009.", "French", 0, 3834, 475343, 976, 1256700637.820281, "6f3d2421c99cf1c28f7ea48685e92bcd.zip"]

See that "579" at the beginning?  That's the important number you want to keep track of -- just use the number associated with the deck that you found.

3)   Open up the web page http://anki.ichi2.net/file/get?id=579 but replace "579" in the address with the number associated with the deck you want to download.  You should be prompted to download a "Get.zip" file. (NOTE: This doesn't work very well in Google Chrome, but Internet Explorer won't give you any trouble.)

4)  Open the zip file.  "Shared.anki" is the only file you need to concern yourself with, so download it somewhere on your computer.

5)  Open Anki and click the "Import" button to select the "Shared.anki" file we just downloaded.  You're set!


NOTE:  Here is the error message I was receiving.  It's very likely that something is just blocking the access or DNS settings need to be tweaked.  I'm positive that my office has security settings in place that make it unreliable.


File "ankiqt\ui\getshared.pyc", line 64, in fetchData

File "urllib2.pyc", line 124, in urlopen
File "urllib2.pyc", line 383, in open
File "urllib2.pyc", line 401, in _open
File "urllib2.pyc", line 361, in _call_chain
File "urllib2.pyc", line 1130, in http_open
File "urllib2.pyc", line 1105, in do_open
URLError: <urlopen error [Errno 10061] No connection could be made because the target machine actively refused it>