May 2007 - Posts

For IT projects, silence can be deadly

 Larry Linson, fellow Access MVP, mentioned the following article a while back.  Well worth reading

 For IT projects, silence can be deadly   Five key conversations can mean the difference between success and failure in IT project.

 I was reminded on this after doing an afternoon's general purpose computer trouble shooting for the brother of a friend.  After several days I gave him a call to see how things were going.  His first comment to me was "It's nice that you're asking how things went.  That doesn't happen any more these days."  I laughed and replied that I wanted to make sure I hadn't made any mistakes.

 (The fundamental problem was that he was using a three year old program that hadn't been obsoleted by the vendor and wasn't compatible with Internet Explorer 7.  In the end I just uninstalled IE 7 from his computers.  While IE7 is more secure they seldom visit the Internet from those two computers.)

 I've made the mistake in the past of not keeping in touch with clients.  I'm sure that if I had given them a call every six months or year or so I would have some repeat business.  But more importantly I would've kept them happy.  But when you're moving from one project to another and always a bit behind it's quite difficult to sit back and think about things.

Posted by Tony | with no comments

Shut Up I Hack You

Shut Up I Hack You  is rather funny.

Posted by Tony | 1 comment(s)

My latest geek toy: Automatic Document Feeder Scanner for $120

I've resisted buying a scanner without an automatic document feeder because I knew that I'd never use it enough.  Open the lid, press a button, wait a while.  Repeat.  Forget it.  Not going to happen.

Four or five years ago I came across one from HP for $550.   Nice but too pricey. 

Went looking again a few weeks ago.  Saw one for $300.  Nah, let's keep looking.  Came across a Brother multi function device DCP-540CN USB Printer  which had a ink jet printer built in for $120.  And a 10 page automatic document feeder.   Aha says I. 

(When the ink cartridge goes dry I won't bother replacing them.   I have a HP colour duplex laser printer.  But in the meantime I'll use the Brother printer as my default printer to get what I can out of the inkjets.)

Painless.  I just put in five or ten sheets in the ADF, pressed the colour button and a minute or two later the software opened up a scans folder directory with a PDF file in it.   I think that's set for 300 dpi which is excessive.  A few days ago I had three sheets in B&W so I hit the B&W button and same thing but at 100 dpi.

And this thing comes with a network port which I've since setup.  Now when I hit the scan button on the scanner I can see the device name of my laptop.

 The software is also quite easy to use.  There are four setup scan buttons in the software.  You can also create four of your own scan buttons. 

So now I can carry my important documents with me.  Hmm, yup, better scan in my passport and drivers license.   I'm also the membership person for a province wide non profit hobby group.  Now when I have meetings or public events I have all the scanned in renewal forms right on the laptop.

Posted by Tony | with no comments
Filed under: ,

New version of SQL Server Migration Assistant for Access available for download

SQL Server Migration Assistant for Access 1.2  - Microsoft SQL Server Migration Assistant (SSMA) for Access is a tool for migrating databases from Microsoft Access to Microsoft SQL Server 2005. SSMA for Access converts Access database objects to SQL Server database objects, loads those objects into SQL Server, and then migrates data from Access to SQL Server.

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

Mousewheel not working in the VBA editor?

I used to use either VBScroll or FreeWheel.   But there is now an official Microsoft solution.  Mouse wheel events do not work in the Visual Basic 6.0 IDE.  I'd suggest staying away from an old version of the Intellipoint software.

Posted by Tony | with no comments
Filed under: ,

Access 2007 runtime will be shipping in a few weeks.

According to Clint Covington, Access PM Hold the runtime download page.  

Also visit Microsoft Access (Office) Developer Edition FAQ if the runtime is of interest.

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

Using the Auto Front-End Updater by Tom Wickerath

Tom Wickerath, fellow Access MVP, created a downloadable file Using the Auto Front-End Updater which is an excellent alternative to my Getting started with the Auto FE Updater page .  (Writing user friendly documentation is one of my few weaknesses.)Smile

 That page as been updated accordingly.

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

Microsoft Office Access Makes a Difference

Fellow MVP Steve Schapel reminded me of his Real World Access series at Microsoft Office Access Makes a Difference.  Well worth reading. 

"It appears that Access is sometimes not well understood in some quarters. On the other hand, if there is a requirement for an economical, feature-rich desktop database application, it is difficult to find a better tool for the job than Access."
Posted by Tony | with no comments
Filed under:

Access Junkie's website specializes in Access 2007

Jeff Conrad, former MVP, just updated his Access Junkie website with Access 2007 specific Knowledge Base articles. He's also updated the MSDN and Links pages.

Jeff is a former MVP as he did such a good job as an MVP and book author Microsoft hired him.   And Microsoft employees are not allowed to be MVPs.    We're taking over Microsoft.Smile

Posted by Tony | with no comments
Filed under:

I love Microsoft OneNote

 I love Microsoft OneNote.  It's a great place to put all those miscellaneous notes about your business, personal and hobby life which don't belong anywhere else.  Now I use lots of software for other more categorized items.  For example many Access tips go into my NewsgroupAnswers MDB as I assume I could easily be reposting those tips in the future.  Contact info and appointments and such go into my Palm and it's associated desktop software.

 But what about all the other bits of information? Put your URLs as shortcuts in your browser?  Recreate your computer operating system or move to a new computer and you've lost those.   Or just random sentences, paragraphs or typed in notes about a phone conversation?

 But the photo of the man on the OneNote Canadian website has a stony faced expression.  It almost looks like he's going to fire you.

 One thing I did do was to create notebooks to help categorize my life.  I was getting too many tabs at the top of the OneNote form.  So I create a notebook for my personal notes and another for a hobby.  Then I dragged and dropped pages and folders from my single notebook to these other notebooks.  And now I have the tabs at the top of the screen down to a managable number.

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

Resume in code after an error message

Folks

So you're working in a module with error handling and you land up in the msgbox routine.   How do you determine what line cause the error and how do you easily get back there?  When at the message you hit Ctrl+Break and choose Debug you end up on the Msgbox line.

tagError:
    MsgBox Err.Description
    Exit Sub      <<<<<<<<<<

 Add the following line below the Exit Sub line

    Resume

Then either right click on the Resume line and choose Set Next Statement or click on the Resume line and hit Ctrl+F9.   This will then move the active line of code pointer to the Resume line.   Then press F8 to continue executing on the line that caused your error.

This simple tip was first mentioned by Len Hannam at an Edmonton Visual Basic and Access (VBAD) users group meeting a number of years ago.  He couldn't recall where he'd heard it last.

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

Access 2007 VBA Programmer's Reference by fellow MVPs

Available now - Access 2007 VBA Programmer's Reference by, among others, fellow MVPs Teresa Hennig and Armen Stein.   As I haven't read it myself I can't give a review.  However Teresa and Armen both strike me as being competent and knowledgable.

Posted by Tony | with no comments
Filed under: ,

Excellent interview with fellow MVP Teresa Hennig

Well worth reading. CIPS Connections Teresa Hennig Interview by Stephen Ibaraki.  Lots of information about user groups.

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

Interesting bug in column headings of list boxes in Access 2007

A client asked why some code behind a list box suddenly started updating 57386 records in a table instead of the expected 38 records.  Turns out the problem is a difference in behavior between Access 2007 and previous versions of Access.  The following code selects all 38 records in the list box in A2003.

    For lngLoop = 0 To Me.lstUnreceivedPieces.ListCount - 1
        Me.lstUnreceivedPieces.Selected(lngLoop) = True
    Next lngLoop

However in Access 2007 the above code also selects the heading line.  You can visually see the difference on the list box between Access 2003 and Access 2007.

Now strictly speaking the code should've started at 1 and not 0 to avoid selecting the heading line.  But that wasn't a problem in A2003 and earlier.  And I can certainly see a developer not even thinking about this issue.

So later on his query then had the following as part of his WHERE clause

     Pieces.pID=pID OR Pieces.pID=52811 OR ...

instead of

     Pieces.pID=52811 OR ...

Needless to say all 57386 records were updated.

So now we need to go into every list box in every app and double check this behavior.

This bug has been reported to Microsoft.

Update:  Ken Snell, fellow MVP couldn't recall where he got the ideo from in the first place but the suggestion is changing the For line to read

    For lngLoop = 0 - (Me.lstUnreceivedPieces.ColumnHeads) To _
        (Me.lstUnreceivedPieces.ListCount - 1)

Nice trick that.

Note that this problem happens whether the Multi Select property is simple or complex.

Update:  You can download the file and open it in both A2003 or earlier and A2007 to see the difference.

Update:  You can either search through all your code looking for .selected or run the following code to open all forms with list boxes in design view.

Sub FindFormsWithListBoxes()

    Dim doc As Document, ctl As Control, Count As Long, Form As Form
    Dim db As Database, ListBoxOnThisForm As Boolean
   On Error GoTo FindFormsWithListBoxes_Error

    Set db = CurrentDb

    For Each doc In db.Containers!Forms.Documents
        ListBoxOnThisForm = False
        DoCmd.OpenForm doc.Name, acDesign
       
        Set Form = Forms(doc.Name)
        For Each ctl In Form.Controls
            If ctl.ControlType = acListBox Then
                ListBoxOnThisForm = True
                Exit For
            End If
        Next ctl
        If ListBoxOnThisForm = False Then
            DoCmd.Close acForm, doc.Name
        Else
            Count = Count + 1
        End If
tagNextForm:
    Next doc

MsgBox "The " & Count & " forms with listboxes have been left open in design view."

   On Error GoTo 0
   Exit Sub

FindFormsWithListBoxes_Error:
    Select Case Err.Number
    Case 7784 ' This form or report is already being designed as a subform or subreport
        msgbox doc.Name & " is a subform on an already open form so is being ignored."
        Resume tagNextForm
    Case Else
        MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure FindFormsWithListBoxes of Module Module1"
    End Select
    Exit Sub
    Resume
   
End Sub

Posted by Tony | 1 comment(s)
Filed under: ,

Are you reading Microsoft Office Access 2007 Inside Out?

Are you reading Microsoft Office Access 2007 Inside Out by fellow MVPs John Viescas and Jeff Conrad?  If so please post an review at the Amazon website.  After clicking "Preview", click the "Create a Pen Name" link if you do not want to use the "Real Name" feature.  From other MVPs comments I know that once I need to start using Access 2007 in a big way I will be wanting this book.

John is a long time author of Access related books and one of the few MVPs still in the MVP program ten or twelve years later.  Jeff is no longer an MVP because he is now a Microsoft Employee.  He did such a good job in reporting bugs during the writing of the book Microsoft employed him as a software tester.   Congratulations Jeff.

Posted by Tony | 1 comment(s)
Filed under: ,

Tip on renamed field names and debugging reports

I posted a tip to the MVP private discussion group and Clint Covington of Microsoft liked it enough he, with my permission, put it on his blog. Tip on renamed field names and debugging reports

Posted by Tony | with no comments
Filed under: ,

Debugging VBA code and docmd.close

An interesting problem came up when working on a very complex time sheet data entry form.   There are times when I want to close the form automatically.  Turns out that when you've debugged code, and the focus is set to the VBA IDE, running Docmd.Close closes the VBA IDE code window and exits your database.   You can try this yourself by Ctrl+G to open the Immediate window and key in Docmd.Close yourself.   Took me several hours to figure out what was all going on here.  I initially thought I had some corrupt code.

 Ok, I figures.  I'll just put a DoCmd.Close acForm, Me.Name.   Worked fine for a few days until ...

That particular form allows you to enter up to three labour transactions for the same employee.  For example, RT (regular time), OT (over time) and DT (double time.)   Then I allow the user to pull up another form showing you the transactions just entered.  Then the user can open a second instance of that same form to update one of those just entered transactions.  Turns out the DoCmd.Close acForm, Me.Name closes both instances of the form.  Not the wanted behavior.

So I added a line of code 'Me.SetFocus" and then Docmd.Close just the current form. 

Posted by Tony | 5 comment(s)
Filed under: , ,