Solved

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

Posted on 2013-01-05
10
311 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
Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

 

Author Comment

by:Pat1120
ID: 38747238
I'll let you know if this works
0
 

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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
randomize data from excell cell 15 45
Web Query 1 19
Clear a Text Box 7 23
best way to protect an excel questionnaire 5 26
My experience with Windows 10 over a one year period and suggestions for smooth operation
This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…

809 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