Solved

Access 2003 problem with Trim and Format$ functions after moving Database to new computer with Windows 7

Posted on 2013-01-05
10
288 Views
Last Modified: 2014-12-24
Got a new computer 64 bit with Window 7 bit Home Premium.  Installed Office 2003 Professional and made sure all of the updates were applied.  Moved my database file (which was created in 97 and converted to 2000 and finally to 2003).  The current database runs on a windows XP machine with Office 2003.

On the new PC, the database will open and process correctly but whenever the code utilizes a TRIM or FORMAT$ functon it gives you and error and stops.   I don't convert things very often but I sorta recall when I converted to Office 2003 back when I had to do somethng with the MSJET40.dll program and then everything started to work correctly.  I do have a the MSJET40.dll module  version 4.0.9756.0 created 7-13-09 in 2 directories.  Windows\sysWOW64 and Windows\Winsxs\X86_microsoft-windows-M..-components-jetcore......... .  I have also tried to see if I have any missing references in my database and I can't find anything that says something is missing.  

Appreciate any help - hope this is not a question asked before but in just a different format.
0
Comment
Question by:Pat1120
  • 4
  • 4
10 Comments
 
LVL 76

Expert Comment

by:GrahamSkan
ID: 38747000
You do seem to have hit a common problem that occurs with VBA and VB6. The symptom is that the built-in string functions fail if there is anything in the References list marked as 'MISSING'.

However you say that you have checked for that.

What is the error number and message?
0
 

Author Comment

by:Pat1120
ID: 38747207
Ok I ran  the data base and it gave me a box that had the name of the funtion at the top and the message "Enter parameter Value" .

here is how I have the text boxs coded:

Name: field50
Control source: = Format$([customer setup date],"yy")&"-"&[customer number]

Name: Text85
Control source: = Trim([Customer city]&","&[customer state]&"-"&[customer zip code])

How I decided that no modules where missing is I opened the report in design view and from the tools i choose macro and then visual basic editor and then references again- this gave me a list of available references:  I only have 4 checked and nothing about anything missing.  I boxes checked are:

Visual Basic for Applications
Microsoft Access 11.0 DB object library
ole Automation
Ulility

It's been about 4 years since I done anything to my program so I wasn't very profience than and really lost now.     Thank you for helping me out
0
 
LVL 76

Expert Comment

by:GrahamSkan
ID: 38747223
I don't know that last one, but I think that you will need references to Microsoft DAO object library, the Microsoft Office Library, and the Microsoft ActiveX Data Objects library.
0
 

Author Comment

by:Pat1120
ID: 38747238
I'll let you know if this works
0
U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

 

Author Comment

by:Pat1120
ID: 38747246
Graham,

should I check all of the Microsoft activex data libraries amd microsoft Office libraries there are  quite a few to choose from?
0
 
LVL 76

Expert Comment

by:GrahamSkan
ID: 38747521
Choose the latest (and don't forget the DAO library).
0
 

Author Comment

by:Pat1120
ID: 38747608
Graham played around adding libraries and finally got the trim function to work but never could get the Format$ function to not be an error so I just went in a changed all uses of the Format$ to just Format and every thiings seems to work and look  Ok.   Know it's not the fix I was looking for but whatever works.   If you have any other ideas let me know and I'll try them so if others this problem we might know of a fix.

Thanks for you help
0
 
LVL 76

Accepted Solution

by:
GrahamSkan earned 500 total points
ID: 38747686
In VBA and legacy VB Format and Format$ should both work, just as Left and Left$, Trim and Trim$, etc.  The trailing $ signals to the compiler that it is a string function. Without it, the compiler takes a trifle longer to work that out.

Type suffixes are considered to be obsolete, and are not usable at all in VB.Net or VBScript.

I understand that your code is running now, but if you still want to pursue the Format$ problem, remember that if you want to help with any error, you should provide the text of the error message, the number and the code of failing line.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

PaperPort has a feature called the "Send To Bar". It provides a convenient, drag-and-drop interface for using other installed software, such as Microsoft Office. However, this article shows that the latest Office 2016 apps (installed with an Office …
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
This video shows the viewer how to set up and create Footnotes in their document. Click on the References tab: Select "Insert Footnote": Type in desired text:
This video shows and describes the main difference between both orientations in Microsoft Word. Viewers will understand when to use each orientation and how to get the most out of them.

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now