Solved

Access DB created with vba code/reference update?

Posted on 2004-08-03
8
550 Views
Last Modified: 2010-10-20
Hi everyone I have made a Access DB and have several forms with vba code, I have made a MDE file but wanted to know because all the refereneces (word and excel) are linked to office 2003 applications will this database work with older office 2000 or xp applications? such as excel and word? and when the new microsoft applications will come out will these references still work - will they upgrade themselves? or would i have to go to the mdb file and do it myself?
0
Comment
Question by:eazy123
  • 4
8 Comments
 
LVL 34

Expert Comment

by:flavo
ID: 11701343
If you use early binding then no.

You'll need to use late binding. (its slower though)

You dont need refrences for this, so get rid of them

Example usage

Dim objExcel as object

Set objExcel = CreateObject("Excel.Application")

0
 
LVL 34

Accepted Solution

by:
flavo earned 125 total points
ID: 11701354
I had a similar Q today, heres one of my comments

Early v late binding:

Early binding
- Need to add a refrence (Tools - refrences)
- Faster
- Will fail if the exact refrence (dll) is not on the pc
- use like Dim xl as Excel.Application
             Set xl = New excel.application

Late Binding
- slower
- No refrences (tools - refences)
- Will work on for example Excel 97 if you develop on Excel 2000 (if same properties / methods were present)
- Use like - Dim xl as object
                set xl = createobjecy("excel.application")
0
 
LVL 34

Expert Comment

by:flavo
ID: 11701370
It is one of the problems from using early binding.  

I generally code everything up firstly with early binding so i get the IntelSense working, then once its all tested and debuged, change it to late binding just incase.

Dave
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:eazy123
ID: 11701383
how do i change it to late binding?
0
 
LVL 34

Expert Comment

by:flavo
ID: 11701459
Take away the refreces to Excel and word (leave Access)

Then replace anything that says

Dim xl as Excel.Appication

with

Dim xl as Object

and replace anything with

Set xl = New Excel.Application

with

Set xl = CreateObject("Excel.Application")

Dave
0
 
LVL 84

Assisted Solution

by:Scott McDaniel (Microsoft Access MVP - EE MVE )
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 125 total points
ID: 11703298
Actually, Access is USUALLY "intelligent" enough to update references ... for example, I use Excel 2000 on one dev computer, and most of my clients use 2002 ... if I make a reference to Excel 2000 on that laptop, build an .mde, and deploy it to their machine (with Excel 2002 installed), the .mde file will automatically re-reference to the  Excel 2002 library ...

However, you'll notice I said "usually" ... I'd not trust that in a distributed app, and would instead follow Dave's advice re" Late Binding (for more info, search on CreateObject in online help and Google) and check out Mitch Kaplan's site for the most comprehenisve look at this technique:

http://www.trigeminal.com/usenet/usenet026.asp

Terry Kreft's Ref Wizard:
http://www.mvps.org/access/modules/mdl0022.htm

The biggest concern in your environment is that you NOT use version-specific items (for example the Printer object in 2003, which is NOT available downstream) ... if you do this, your code WILL fail. Even if you develop in the 2003 environment with the default 2000 format, you can still use features of 2003 which may not be available downstream ...
0

Featured Post

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
making call from microsoft access to skype for business 5 44
Access Update Query 1 20
Calculate Time acces 2010 12 29
How to use DLookup with IsNull Function 4 26
QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

773 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