Jul 01

Microsoft Access Inconsistent Compile Error for a Field Reference in a Form

Our Professional Solutions Group was recently asked to diagnose a Microsoft Access database experiencing recurring compile errors with code behind a form that looks like this:

If IsNull(Me.Comments) Then

where Comments is not a control on the form, but a field in the form’s RecordSource.

In general, this compiles and runs fine, but on seemingly random occasions while the program is running, it generates a compile error saying that that field was not found. But the field always existed on the form’s RecordSource, so why was this happening?

Solutions

There are a few ways to avoid this problem:

  • Change all the Me. to Me! which is the proper way to reference a field in VBA code, if there is no control bound to this field.
  • Create an invisible  text box that assigns its ControlSource to that field, give the text box a different name (e.g. txtComments), and reference the text box in code.
  • Deploy the database so its compiled state cannot be changed (ACCDE or MDE)

We prefer the use of the invisible text box so that we can reference the control name via the “Me.” syntax rather than “Me!”. The “Me.” syntax is verified when the code is compiled so that a typo with the control name is caught. This is preferable to a runtime error that gets triggered when the user encounters that line of code.

But Why?

Though we knew how to fix this, we were curious to understand why the compilation wasn’t consistent across users. It also didn’t fail when a specific event occurred. It seemed almost random when the compile error arose. And the form triggering the error seemed perfectly fine with a reference to a field that exists in its RecordSource.

The Real Cause for the Compile Error

Through our own research and help from our Microsoft Access MVP colleagues, we discovered that the compile error was tied to programmatically changing the RecordSource of a form. The change is not necessarily on the form where the compile error is triggered.

Microsoft Access seems to reset its internal list of field references some time after the RecordSource is modified, which triggers the compile error. This explains why some users experienced it and others did not since it depended on whether the user opened a form that changed its RecordSource. It also explained why the error didn’t occur immediately after a RecordSource was modified.

Special thanks to Dirk Goldgar for pointing this out. Hope you never encounter this!

Additional Resources for Database Compile and Field Reference Issues

For additional tips on Microsoft Access application development, visit our:
Microsoft Access Developer and VBA Programming Help Center

Jun 20

Analysis of Telephone Call Data Records with Sentinel Visualizer

Discover more about Telephone Call Data Records Analysis


What valuable information can you get out of huge amounts of telephone call records?

The US government is trying to collect all the telephone call data records (CDR) for US and international phone calls though its PRISM program. Does having this information constitute snooping? Is it an invasion of privacy? Or can it really help investigators track, find, and thwart threats?

Does it Matter with So Much Data?

With billions of phone calls, how could anyone possibly find anything of value amid all the innocent, unrelated calls? No one can possibly gain significant insight looking at an Excel spreadsheet or a database showing rows and columns of all those calls. Isn’t it just noise?

How Sentinel Visualizer Analyzes Call Data Records

Without advanced analytics software, the data is overwhelming. Our commercial Sentinel Visualizer program from our Advanced Systems Group provides a platform to gain insight into the massive number of phone calls. It’s about managing large amounts of data, seeing the relationships between entities (phone numbers and people), drilling down where necessary, and filtering based on time, geography, and relationships:

  • Call detail records are imported into the Sentinel Visualizer database (SQL Server)
  • Link Analysis Networks can be used to visually see the calls made by any phone number
  • Multiple levels of phone calls can be linked to identify groups of phones related to each other (cells of activity)
  • Geospatial Mapping and integration with Google Earth to see calls across the world
  • Social Network Analysis (SNA) to identify related phones (cells) and spanners between cells
  • Temporal Analysis can be used to filter data to specific time ranges
  • If information exists for known individuals and their phone number(s), related phones can be quickly identified as warranting additional investigation
  • Link Traversal Analysis can be performed between two phone numbers to show all the phones related to them through multiple levels, and quickly filter out the unrelated calls to identify the “community of interest”
  • Numerous reporting and exporting options: print diagrams and customized reports, or export them in image, PDF, Word, Excel.

Link Analysis Network Visualization of Telephone Call Data Records (CDR)

Learn more here.

Jun 14

New Technical Support Forum and Ticket Tracking for FMS

We are very pleased to announce our new technical support site (http://support.fmsinc.com) to provide forums and the ability to submit technical support inquiries.

Our new site lets you submit requests and respond to them via email with our support team. It also lets you visit our site to check the status of your requests and their entire chain of communications. You can login directly or use affiliated logins from Facebook, Google, and Twitter.

You can also read information and ask questions to the community on topics related to Microsoft Access, Visual Studio, LightSwitch, and SQL Server. We hope you’ll join us.

Additional support resources are available here:

Jun 07

Comparison of Microsoft Access, LightSwitch and Visual Studio Platforms for Database Developers

Last month I spoke at the Portland Access Users Group Conference at Silver Falls State Park. I gave a presentation introducing Visual Studio LightSwitch and how it could be used for SQL Server applications deployed on a variety of platforms. As a follow-up, I’ve created a summary matrix and discussion that highlights the features and limitations of the variety of platforms from Microsoft Access, Visual Studio LightSwitch, and Visual Studio.


Microsoft Access started at the beginning of the Windows revolution 20+ years ago and became the most popular database of all time. More recently, additional technologies have become significant, so it behooves the Microsoft Access community to be aware of the trends and options.

Database Platform Matrix

Ultimately, it’s about being able to create solutions that help you and/or your users accomplish their mission. Sometimes the user’s platform is critical, sometimes, it’s the data source, and other times it’s the permissions you have to deploy a solution. A variety of platforms and options are available with benefits and limitations with each. Meanwhile, Microsoft Access is also evolving with their latest Access 2013 version offering new web based solutions.

We’ve written a new paper, Comparison of Microsoft Access, LightSwitch and Visual Studio Platforms for Database Developers  that summarizes what we’re seeing and experiencing.

May 01

Be Careful Making Appointments on Your Smartphone from a Different Time Zone

Microsoft Outlook Tips and Techniques

When travelling in Texas recently, I received an email for a noon lunch appointment the following week. So I added it to Outlook on my Windows Phone as usual.

Unfortunately, I missed the appointment because when I returned home to Eastern time, the appointment appeared on my calendar as 1 PM (noon in Texas). It was rude, embarrassing, and bad for business.

Read our new paper, Missing an Appointment Set on a Smartphone while in a Different Time Zone on how to avoid this.

Mar 13

Mistakenly Blaming Microsoft Access instead of the Developer

In this March 10th Washington Post article, Alexandria tailor weaves custom solution for taking orders, a local firm is mentioned having struggled with Microsoft Access and being forced to migrate to a new system due to problems with their Access database. In particular, their database couldn’t provide multiuser support and lost data when more than one person used it.

Unfortunately, stories like this perpetuate the myth that Microsoft Access features are limited rather than the lack of skills of the developer who tried to customize it. It’s a shame the business owner and developer weren’t aware that Access could address the multiuser issues they encountered; thereby saving time, money, and headaches from having to migrate to a new platform.

Microsoft Access is Multiuser Ready

Microsoft AccessThe reality is that Microsoft Access is fully capable of providing multiuser support if it’s designed properly. For basic database solutions with under 1GB of data (maximum 2GB), Access comfortably supports up to 200 simultaneous users with a properly designed solution.

Microsoft SQL ServerAs the number of users and data expands, Access makes it relatively easy to migrate the data storage from an Access database to SQL Server, while maintaing the application layer (forms, reports, code, etc.) in Access. This also lets you share the SQL Server data on web sites and other platforms. That means supporting two users in a tailor shop would be trivial with MS Access.

Split Database Architecture for Multiuser Solutions

People sometimes treat Access databases like Excel spreadsheets and want each user to open and close the same file. That’s not the way to support multiuser data sharing in Access. A split database architecture is needed to separate the application layer from the shared database. Each user gets their own copy of the front-end database application that links to the tables in the shared database.

Microsoft Access includes a built-in wizard to split the database and another wizard to link the front-end database to back-end tables. We wrote a paper about this years ago called, Microsoft Access Split Database Architecture to Support Multiuser Environments, Improve Performance, and Simplify Maintainability.

While having a web application has its role and advantages, the article mentions their internet connection isn’t reliable and their business is negatively impacted when that happens. That’s an unfortunate result of their new platform. There are ways to create hybrid solutions to provide on premises support with shared web solutions, so these issues need to be considered when creating business critical solutions.

Using Microsoft Access Strategically

Small businesses often have very limited budgets and time to understand technological options. Completely eliminating Office and Access as viable solutions for incorrect reasons is wasteful. Microsoft Access addresses an important segment of database needs, and offers small businesses and information workers the ability to make modifications and extensions that other platforms do not allow so easily. Understanding where and how to use Microsoft Access effectively along with its limitations offers organizations of all sizes a competitive advantage. We’ve helped many small businesses, non-profits, and multi-national companies properly use this technology very effectively. Here’s our article on Microsoft Access within an Organization’s Database Strategy that discusses this in more detail.

Conclusion

There are lots of terrible applications created on every technology platform whether it’s Microsoft Access, Excel, Visual Studio, Java, Oracle, SAP, etc. In this case, the skills of the Access developer were clearly lacking. Getting that confused with the technology is misguided.

Additional Resources

For additional resources to build robust Microsoft Access solutions and understand what’s possible, visit our:

Feb 18

Attending the Microsoft MVP Summit in Bellevue/Redmond, WA

I’m attending the annual Microsoft MVP Global Summit this week in Bellevue and Redmond, WA. This is actually my first experience at this event as I was awarded the MVP title this past summer for my support of Microsoft Access.

Over the years, FMS has had several Microsoft MVPs for Access including Dan Haught, Steve Clark, and Jim Ferguson who was one of the original MVPs when the program started 20 years ago. Book author Alison Balter and Portland Access User Group leader Jack Stockton join me as new MVPs this year. Last night we had a nice kickoff event with fellow Microsoft Access MVPs.

The MVP conference brings together 1500 professionals from across the world to this conference. The MVPs cover all the different product groups for Microsoft which offers a wonderful mix of expertise and enthusiasm. Over the next few days, the different Microsoft product groups will be providing presentations to attendees in an NDA environment. Sorry, I can’t share the content, but I can say it impacts our future planning.

Yesterday, they had a showcase of a variety of technologies from MVPs in the US plus companies from Taiwan, Japan, Germany, China, India, etc. It’s great to see the global impact of Microsoft.

How do you become an MVP? The usual path is to be involved in public forums answering questions and becoming an expert in the field. You don’t need to own a business to be an MVP. Other ways to be selected are to increase your professional visibility through products, writing books, blogs, etc. The MVP program is designed to recognize individuals who influence the market and help the community maximize the value of Microsoft products. So whether it’s XBox, Bing Maps, Dynamics, Exchange, Office 365, Excel, Outlook, PowerPoint, SharePoint, Visual Studio, Windows Phone, Word, etc., if you have a passion, expertise, and a willingness to share, the MVP community could be part of your future. Good luck!

Feb 12

Portland Oregon Microsoft Access User Conference

Silver Falls State Park, Oregon
May 4-6, 2013

FMS President Luke Chung is one of the featured speakers at this annual Microsoft Access conference hosted by the Portland Access User Group. This will be his third year speaking at this wonderful event.

Enjoy an amazing, rustic getaway to a beautiful state park with fellow Microsoft Access enthusiasts. Book early so you can stay at the limited number of cabins available at the conference center. The conference fees are amazing low and includes meals.

LightSwitch and Microsoft AccessLuke will participate in various talks on Microsoft Access development, running a business, and creating solutions using Visual Studio LightSwitch. He’ll also be staying at the site during the entire conference, so you’ll have plenty of opportunity to meet him formally and informally.

For more information, visit the conference site.

Feb 11

Welcome to the New FMS Development Team Blog

Welcome to our New Blog

We’ve migrated our blog to WordPress from our previous BlogEngine.NET platform. We hope you like it.

WordPress has become the most common Blogging format, so we’re happy to simplify the process for people to participate in our blog with their WordPress login. We also gain considerably more options for designing the layout of our blog.

We could have started our new blog from scratch but since our existing blog existed for many years, we wanted to migrate it with all the comments from our BlogEngine.NET host to WordPress. That turned out to be a challenge that required learning the idiosyncracies of BlogEngine and WordPress. With the help of Microsoft Access, we created a table with the terms that needed to be translated, read the XML file from BlogEngine, then created a new XML file that WordPress would import.

For details of how we did it, visit
Migrating BlogEngine.NET Posts to WordPress with Translations Using Microsoft Access.

Feb 11

Migrating BlogEngine.NET Posts to WordPress with Translations Using Microsoft Access

Migrating Our Site from BlogEngine.NET

We could have started our new blog from scratch but since our existing blog existed for many years, we wanted to migrate it with all the comments from our BlogEngine.NET host to WordPress. That turned out to be a tricky process but we managed to do so. To help others who might be facing the same situation, here are the steps we followed so you don’t have to make the same mistakes we did:

Prepare the Existing Blogs for the Migration

The first step is to make sure your existing BlogEngine.NET blog is working properly and ready for export. One of the tricky and time-consuming parts of this is the reference to graphic files. BlogEngine stores its embedded graphics in its own structure using syntax similar to this (our blog was in the BLOG folder):

src=”/blog/image.axd?picture=banner.jpg”

Note that this only impacts graphics that were uploaded into BlogEngine. If you referenced images that already existing on your website, those references are fine and do not need to be modified.

To fix the image.axd? references and eliminate future dependencies, it’s best to store these graphics in your website explicitly. Once you save the graphic files, you can update your blogs to reference them. Saving the individual pictures is a manual process and you’ll need to decide where to store them on your website. You can then manually update the affected blog topics. Alternatively, you can do a search and replace later after exporting the blog’s XML file. We did a combination of both.

Export the existing BlogEngine.NET data to an XML file

Export the existing BlogEngine.NET data to an XML file. This is available as the last option under Settings from BlogEngine. The default name is BlogML.xml

Unfortunately, even if you fixed the picture image references, you’ll still need to translate the file to a format that WordPress can import. That requires making many changes. We actually exported the XML file, then parsed it to find the references to

src=”/blog/image.axd?

to identify any image references that were still in BlogEngine. That gave us the choice to either fix the original blog and re-export, or to fix it directly in the XML file.

Preparing WordPress

The WordPress import tools are under Tools, Import. To import the BlogML file, you need to install the appropriate WordPress PlugIn. The BlogML plugin that worked for us was BlogML-WordPress-Import.zip which can be found here. You’ll need administrator write rights to your WordPress folders to install this.

Before you modify the BlogML file, you may want to import it to see the problems that need to be addressed in WordPress. You can do so and trash them in WordPress without any harm.

Using Permalinks with Post Names

By default, WordPress saves and displays its posts by ID number in the URL. If you want posts to have more meaningful names which also helps with SEO, you should set the preference under Settings, Permalinks, and choose Post. We set this but the pages triggered a 404, Missing File problem.

We discovered that this translation didn’t work on our WordPress host (Windows using IIS) unless we added a web.config file in the root of the blog with this information:

<?xml version="1.0"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Main Rule" stopProcessing="true">
url=".*" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="index.php/{R:0}" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>

Translating the BlogXML file with Microsoft Access

Now that we established the foundation to import the XML file and display the posts with the proper Permalinks, we could see several things still need to be fixed. It was relative easy to do with multiple search and replace terms. We did this in Microsoft Access:

  • Create a table with two text fields. One for the Original value and one for the New value to replace it. We then populated the table with the terms to translate:
    • Hyperlink references. Since we migrated our blog from a subfolder (www.fmsinc.com/blog) to its own subdomain (blog.fmsinc.com), we needed to modify all the hyperlink references that were pointing to our web pages to explicitly point to our www.fmsinc.com web site. That meant, we needed to adjust our href=”/ syntax to “href=”http://www.fmsinc.com/”, so we added these two values to our table.
    • Existing Image references. Similarly, we needed to adjust our image src=”/ references for graphic files to “src=”http://www.fmsinc.com/”, so they were added. Note, we didn’t search for “img src”  because many references included style settings between the “img” and “src”.
    • New Image references. This is also the time to add any explicit image.axd? references to the new location of the graphics if you didn’t want to manually edit the original posts.
  • Total Visual SourceBookBlogEngine saves category names as GUIDs and references the GUIDs in each post. If you don’t translate these, they’ll be imported into WordPress with the GUID rather than readable category name. We used the CXMLSettings class from Total Visual SourceBook to read the categories section of the XML file so we could pair the GUID and category names.
  • Perform the Search and Replace
    Once the table contains all the terms to translate, we wrote a simple routine to read the XML file into a variable, then go through the table and use the VBA REPLACE function for each record. When we were finished, we wrote the text to a new XML file for WordPress to import.
  • From WordPress, import the new file using the BlogML import plugin.

Because we programmatically perform the translation process, it was easy to test, run, and refined the entire process when things didn’t work correctly. It took us a few iterations but we were pleasantly surprised how well the posts came across.

We found that we needed to manually touch up some of our posts. The HTML in WordPress doesn’t require the use of paragraph styles (<p> </p>) to define each paragraph and automatically strips them out. Unfortunately, it displays the line breaks in paragraphs which is normally ignored in HTML syntax. We had to manually edit and delete those so the posts properly word-wrapped.