March 2009 - Posts

Package from Malaysia?

Did anyone send me a package from Malaysia?  If so please email me.

Otherwise I'm taking it to the RCMP for them to open it. 

There are a few people on the Internet in the newsgroups who really, really don't like me.

Posted by Tony | with no comments
Filed under:

Microsoft DreamSpark enables students to download Microsoft developer and design tools at no charge.

"Now, for the first time, Microsoft is giving its valuable software developer and design tools directly to students worldwide at no charge! This site enables students, like you, to download professional-level Microsoft developer tools to advance your learning and skills through technical design, technology, math, science and engineering activities. "

Microsoft DreamSpark enables students to download Microsoft developer and design tools at no charge.

Hmm, Microsoft Access isn't on that list.  <sigh>  But the Robotics Developer sounds real cool!

Posted by Tony | with no comments

Which date is more understandable by the user?

Elapsed time # 1 Elapsed time # 2

While the left screen shot is more technically accurate and appeals to the accountant the right screen shot is much more understandable by the user. They also have a button where they can drill down to get the exact date.  But really if the unit hasn't had an inspection done in 11 months or needs one in 4 weeks the exact date isn't relevant.

These screen shots are from the form showing all the overdue and upcoming inspections from a client with about 1200 pieces of equipment in the Granite Fleet Manager

This code was based on the Access team blog entry Constructing Readable Time Elapsed Strings – MSDN article.  I had one minor grammatical suggestion which is viewable as community content on the bottom of the MSDN article.

I've seen these kinds of dates on various web sites and had vague thoughts of writing the code but it was way down on my roundtuit list.

Nice stuff.  Thanks to Kerry Westphal of MS for creating this.

Posted by Tony | with no comments

School sends letter to parents of dead teenager complaining about her poor attendance

School sends letter to parents of dead teenager complaining about her poor attendance

The relevant paragraph is:

He said: "Unknown to the school, Megan's details had remained in a different part of the computer system and were called up when the school did a mail merge letter to the parents of all Year 11 students. The letter called up details of each student's attendance for the whole year to date and because Megan had been on roll in September, she was included.

As heartbreaking as this story is I can see how easily this could happen.  Furthermore if a power user created their own query and did their own mail merge that makes this problem even easier to happen.

Mind you that bit about details in a different part of the computer system sounds like bad data normalizing.

I frequently have an Inactive Yes/No field on my tables as appropriate.   And frequently it's somewhere near the end of the list of fields so it's easy to miss for someone not thinking about such.

In the Granite Fleet Manager on the equipment table I went a step further.  I have a status field linked to a status table.  This handles the situation where equipment is temporarily out of service due to lengthy maintenance/rebuilds, loaned out to other organizations or whatever the client desires.  That status table has a Yes/No Inactive flag. 

Posted by Tony | with no comments

"Slacker DBs" Vs. Old-Guard DBs

A very interesting summary at Slashdot - "Slacker DBs" Vs. Old-Guard DBs on an InfoWorld article Test Center: Slacker databases break all the old rules

I saw this problem from a different perspective in 2000 or so when I purchased my Palm Vx.   I was taken aback to only see room for exactly five phone numbers and/or email addresses.   But when I thought about it I realized that was a reasonable limitation given that the concept of Joins almost certainly isn't built into the Palm OS and program.  I quite liked the Palm desktop interface and so that's where I entered much of my information.

A while later my sister purchased a Palm but was using the contact manager built into Outlook.   She occasionally had more than the five contact means in Outlook and was rather ticked that the sixth or seventh wouldn't import. 

But getting back to cloud computing. 

Microsoft is joining the cloud as well with SQL Server under the name Microsoft SQL Data Services as part of the Azure Services Platform.   This is a good thing as I really, really like relational data systems.  With all the other utilities and safeguards available when MS comes at this problem from the SQL Server perspective.

The perspective that folks with no relational database experience bring rather concerns me.

An example of this is MS bringing in Dave Cutler to lead the Windows NT 3.1 team with their multi user, multi tasking experience.  The DOS based folks at MS would've stumbled badly and, in my not so humble opinion, could've done a better job in the Windows 95, 98 and ME family.

For example, formatting a floppy in Windows 95/98 or ME took over the entire system.  You couldn't do anything else.  And yet within OS/2, a true multi tasking system, you didn't notice a floppy being formatted and the task manager showed it only took a few percentages of the CPU.

That all said I can understand why Facebook or other huge non critical sites with hundreds of millions of records would deliberately denormalize their data.   For example denormalizing the contact info or website's would drastically reduce CPU and disk access times thus improving response times.

On the fourth hand all my apps are going to be properly normalized!

Scammer - Domain Registry of Canada (DROC)

Just got my annual letter for one of my domains from these scammers.    But it's a duplicate of the one mentioned on this page  Be Aware: Domain Registry of Canada Snail Mails so I can't be bothered to scan it in myself.

"They look like a government official domain name authority with a Canadian flag on their envelope. They also have the same color envelope that you would expect from Canadian Government. "

Or you can do more Google searches or Live.com searches.

What puzzles me is how they can afford to do this given the cost of postage.   Even with bulk mail discounts.

Note that they appear to be affiliated with Domain Registry of America so the USA readers should be aware of this.

Speaking of which I got a phone call from someone confirming my contact info for some "business directory" website.  Yes, yes, and yes I said as she was rattling off the info.  I was already visiting their website with an official sounding name as we were chatting.  Then she said "It's $175 per year to be listed on our website." <click> And I hung up.

I really should've kept her on the phone for another five or ten minutes leading her on.  And then saying some rude words and slamming down the phone.  But I didn't have the patience.

Posted by Tony | with no comments
Filed under:

A brilliant idea that didn't work - moving a group of controls in a tab control

I created an unbound form in the Granite Fleet Manager assigning equipment to a new location such as a construction job site or fire trucks assigned to a different county to help with brush fires.   If the equipment is already assigned to a location(s) then a subform is displayed showing all the locations along with some unbound fields and a command button to flag the equipment as having been returned from the job site(s).   See the left hand screen show below.

However if the equipment isn't currently issued to a location then only the unbound fields including location and a command button are displayed on the form.   See the right hand screen shot below.  That form looks quite unbalanced and not visually esthetic.  Not, you understand, that I'm overly worried about esthetics but hey.  <smile>

EqupiAssigntoNewLocnLHS  EqupiAssigntoNewLocnRHS

(You can click on the forms to expand them if desired.)

First I created a few lines of code to move the right hand controls up and to the left.

Const TwipsLeft As Long = 2880, TwipsUp As Long = 1440

    For Each ctl In Me.Controls
        If InStr(ctl.Tag, "ReturnEquip") > 0 Then
            ctl.Visible = DisplayReturnEquipment
        End If
        If InStr(ctl.Tag, "AssignToNewLocation") > 0 Then
            ctl.Visible = DisplayNewLocation
            ' Shift the Display New Location fields up and to the left
            If DisplayReturnEquipment = False And DisplayNewLocation = True Then
                ctl.Left = ctl.Left - TwipsLeft
                ctl.Top = ctl.Top - TwipsUp
            End If
        End If
    Next

(The ctl.visible = lines use the strings I placed in the controls Tag property to decide when the controls are visible or not.

There are 1440 twips to the inch. )

In the above code you can see how I used the controls left and up properties to move the control around.

This would've worked just fine if I closed the form after the user executed the command button.   However I allow the user to select a new unit in the combo boxes.  And now I have to move the controls back to where they were.  The only way I could think of doing this was do save the original top and left positions of each control in an array or collection of some sort.   

So I dug out the Access Developers Handbook and started to go through the Controlling Forms chapter.  I saw an interesting heading titled Using the Tab Control as a Container.   Aha.   And there's the answer.  Copy those fields onto a tab control.  Set the tab controls Style property to None and, if required, set the Back Style to Transparent.

Now I just need to save the tab controls Top and Left property on opening the form and move the tab control up and to the left when required. 

This will also come in very handy when I add more subforms to the equipment and/or service order forms.  I'' be running out of room on the single row of tabs.  I'm going to implement a list box on the left hand side of the form to control which tab the user will view.  Continuing to use the tab control will be handy for me to group the controls.  However I don't want the tabs to be visible to the user. 

But the code moving the tab control didn't work. 

When, after executing the code, using debug I displayed the top and left values of the tab control the new values showed the tab control had shifted.     But I could see that it hadn't moved.  Furthermore Task Manager showed one of my two CPUs in my laptop was pinned at 100% until I closed the form.

When I tested the code on a label it moved just fine.

So I, finally, created a new MDB with a form and some simple controls just to test this.  Well the tab control did move in my example.  However the controls placed on the tab control did not move.  Furthermore Access left the lower right hand corner of the tab control where it was to ensure the embedded controls stayed on the tab.

<sigh>

A brilliant idea that didn't work.  I spent hours and hours trying to figure out the problem before I created the test MDB.

So now I have to store each individual controls name, top and left coordinates in either a two dimensional variant array or possibly a collection.  A collection looks like it's more trouble than it's worth so I'll just use an array.

Posted by Tony | 5 comment(s)

Humour: Engineering specifications

I worked on an ERP system for a welding shop which had a lot of pipe so I found the following to be particularly funny.  For example the price book was 40 pages, with 17 pages full of tables with diameter and wall thickness of the pipe on the x and y axis and the price in the grid.  Each of the 17 pages being a different type of weld or joint.  The other 23 pages were the exceptions.

Do you get fired for doing things like this?

I'm still chuckling.

Posted by Tony | 2 comment(s)
Filed under:

What is the best way to understand the tables,queries, relationships,etc?

KrispyData asked the following question in the newsgroups

What is the best way to understand the tables,queries, relationships,etc.  I
am new to Access and taking over an entire database.

Philip Herlihy had an excellent reply well worth reading.   Jeff Boyce, fellow Access MVP, also had some good comments.  I'm sure the discussion will continue for a few days so keep checking back to the thread.  

Any tips on working with a database that you did not create?

Note that KrispyData's original posting did not somehow make it to Google Groups.

Posted by Tony | with no comments

Capturing screen shots

Tired of Alt-PrtScn and various jiggery pokery methods of getting out just the portion of the screen you want?

I've quite enjoyed using SnagIt for the various screen shots on this blog and on my web sites.   In particular I quite like the ability to draw red rectangles around relevant portions of the screens.

A free alternative my friend Jim, whom I've mentioned in the past, highly recommends is Bug Shooting.

Bug Shooting is a free screenshot utility that was developed for software testers who use bug tracking systems including FogBugz, Gemini, Ontime, BugTracker.NET and Mantis Bug Tracker. Screenshots can also be sent to Skype or a default E-Mail application (e.g., Outlook).

Since screenshots are frequently used to show system bugs or to reproduce the steps for a failed test, it is often very helpful to highlight, notate and/or crop areas of the screenshot. With Bug Shooting this can be done in a matter of seconds.

Posted by Tony | with no comments

Bizarre Access 2003 error message

While working on a form I started getting the following message:

The expression On Close you entered as the event property setting produced the following error:  A problem occurred while Granite Fleet manager was communicating with the OLE server or ActiveX Control

* The expression may not result in the name of a macro, the name of a user=defined function or [Event Procedure].
* There may have been an error evaluating the function, event or macro.

ExpressionErrorMessage

I have no idea what started to cause this message.   The Show Help >> button was useless.

Compiling made no difference.  Indeed the VBA editor didn't think the code needed compiling so I had to insert a space to get the compile button to active.

Compacting didn't help.  

What did help though was to save the form under a different name and open the new form.   And all is well.  The code behind those events started working just fine.

Weird.

Posted by Tony | 8 comment(s)
Filed under:

Hiding 70 controls based on a value

At the blog entry Getting a list of control names on a form Nate posted the following comment:

Thanks for the great tip!  It doesn't seem to include labels and command buttons, but it is still a great help.  I have a form where I am hiding 70 controls based on a value, so this saved me some real time.

Thanks for the kind words. 

But a better method might be to use the control's tag property.   See Locking fields on a form in Microsoft Access for more details.  One nice thing about the tag property as that you can use Shift + click to select multiple controls to set the property.

Posted by Tony | with no comments
Filed under: , ,